From: "KOSAKI Motohiro" <kosaki.motohiro@jp.fujitsu.com>
To: "Jack Harvard" <jack.harvard@googlemail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: lmbench memory bandwidth benchmark
Date: Wed, 9 Apr 2008 06:30:32 +0900 [thread overview]
Message-ID: <2f11576a0804081430q4283e6f2t1e573a8362ebecc@mail.gmail.com> (raw)
In-Reply-To: <a72f6a3c0804081045r6eb4c6awdae2f3be0ccc416e@mail.gmail.com>
> hi, can someone help explain how bw_mem function works in lmbench? the
> source code doesn't seem very user friendly, the papers are too vague
> to help understand the code. an example for "bw_mem 512 frd" would be
> very helpful.
maybe, "gcc -E" can help you.
e.g.
$ gcc -E bw_mem.c
got below.
frd(iter_t iterations, void *cookie)
{
state_t *state = (state_t *) cookie;
register int sum = 0;
register int *lastone = state->lastone;
while (iterations-- > 0) {
register int *p = state->buf;
while (p <= lastone) {
sum +=
p[0]+ p[1]+ p[2]+ p[3]+ p[4]+ p[5]+ p[6]+
p[7]+ p[8]+ p[9]+ p[10]+ p[11]+ p[12]+
p[13]+ p[14]+ p[15]+ p[16]+ p[17]+ p[18]+
p[19]+ p[20]+ p[21]+ p[22]+ p[23]+ p[24]+
p[25]+ p[26]+ p[27]+ p[28]+ p[29]+ p[30]+
p[31]+ p[32]+ p[33]+ p[34]+ p[35]+ p[36]+
p[37]+ p[38]+ p[39]+ p[40]+ p[41]+ p[42]+
p[43]+ p[44]+ p[45]+ p[46]+ p[47]+ p[48]+
p[49]+ p[50]+ p[51]+ p[52]+ p[53]+ p[54]+
p[55]+ p[56]+ p[57]+ p[58]+ p[59]+ p[60]+
p[61]+ p[62]+ p[63]+ p[64]+ p[65]+ p[66]+
p[67]+ p[68]+ p[69]+ p[70]+ p[71]+ p[72]+
p[73]+ p[74]+ p[75]+ p[76]+ p[77]+ p[78]+
p[79]+ p[80]+ p[81]+ p[82]+ p[83]+ p[84]+
p[85]+ p[86]+ p[87]+ p[88]+ p[89]+ p[90]+
p[91]+ p[92]+ p[93]+ p[94]+ p[95]+ p[96]+
p[97]+ p[98]+ p[99]+ p[100]+ p[101]+ p[102]+
p[103]+ p[104]+ p[105]+ p[106]+ p[107]+
p[108]+ p[109]+ p[110]+ p[111]+ p[112]+
p[113]+ p[114]+ p[115]+ p[116]+ p[117]+
p[118]+ p[119]+ p[120]+ p[121]+ p[122]+
p[123]+ p[124]+ p[125]+ p[126]+ p[127];
p += 128;
}
}
use_int(sum);
}
prev parent reply other threads:[~2008-04-08 21:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-08 17:45 Jack Harvard
2008-04-08 21:30 ` KOSAKI Motohiro [this message]
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=2f11576a0804081430q4283e6f2t1e573a8362ebecc@mail.gmail.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=jack.harvard@googlemail.com \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®