From: Patrick <plafratt@gmail.com>
To: linux-perf-users@vger.kernel.org
Subject: L1-dcache-stores twice as big as expected
Date: Thu, 30 Apr 2015 19:37:31 +0000 (UTC) [thread overview]
Message-ID: <loom.20150430T211657-416@post.gmane.org> (raw)
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
next reply other threads:[~2015-04-30 19:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-30 19:37 Patrick [this message]
2015-04-30 20:00 ` L1-dcache-stores twice as big as expected Vince Weaver
2015-04-30 20:14 ` Vince Weaver
2015-04-30 20:23 ` Patrick
2015-04-30 20:53 ` Vince Weaver
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=loom.20150430T211657-416@post.gmane.org \
--to=plafratt@gmail.com \
--cc=linux-perf-users@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).