Hi

We have a bunch of memory arrays which are used as communication queues between 
components. I want to count how much those queues are actually used by the 
components by counting the memory accesses. This should be possible with 
Valgrind, but it the actual tool has not been developed yet as far as I 
researched. Maybe somewhere something similar was done already?

For clarification a little pseudo code:

int main() {
        vector<int> a = init_a();
        vector<Image> init_b();
                foo(a, b);
        bar(a, b);
}

void foo (&vector<int> a, &vector<Image> b) {
        for (int i = 0; i < a.length; i+= 10)
                     a[i] = b[i/10].getRed(i);
}

void foo (&vector<int> a, &vector<Image> b) {
        for (int i = 0; i < a.length; i+= 8)
                     if (a[i] == 42)
                b[i%10].setTransparent();
}

The information I would like to get is something like:

Component     Writes a   Reads a    Writes b    Reads b
foo                  243           27              574           235
bar                  833          684             87             3897


The obvious challenges I can see is to identify/mark the components and memory 
regions.

Mit freundlichen Grüßen / Best regards

Andreas Zwinkau
CC-AD/EYF1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to