linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* L1-dcache-stores twice as big as expected
@ 2015-04-30 19:37 Patrick
  2015-04-30 20:00 ` Vince Weaver
  2015-04-30 20:14 ` Vince Weaver
  0 siblings, 2 replies; 5+ messages in thread
From: Patrick @ 2015-04-30 19:37 UTC (permalink / raw)
  To: linux-perf-users

Hello,

I have a simple piece of code that I am analyzing with perf:

int main( int argc, char*argv[] ) {
    if( argc < 2 ) {
        cout<<"Error: need size argument.\n";
        return 1;
    }
    uint64_t sz = strtoull( argv[1],NULL,10);
    uint8_t *a;
    a = new uint8_t[sz];

    for(int i=0;i<sz;i++ ) {
        a[i] = 1;
    }
    return 0;
}

When I run perf like this:

-> perf stat -e L1-dcache-stores:u ./copy 1048576

I get the following output:

-> Performance counter stats for './copy 1048576':
->         2,207,859 L1-dcache-stores
->       0.006255441 seconds time elapsed

I can't figure out why it is recording over 2 million stores to the L1 
data cache. I 
would expect it to be around 1 million. Has anyone seen this before?

Any help is appreciated.

Patrick

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-04-30 20:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-30 19:37 L1-dcache-stores twice as big as expected Patrick
2015-04-30 20:00 ` Vince Weaver
2015-04-30 20:14 ` Vince Weaver
2015-04-30 20:23   ` Patrick
2015-04-30 20:53     ` Vince Weaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).