From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@kernel.org>, Jiri Olsa <jolsa@redhat.com>,
LKML <linux-kernel@vger.kernel.org>,
Namhyung Kim <namhyung.kim@lge.com>
Subject: Re: [PATCH 2/2] perf tests: Add a test case for checking sw clock event frequency
Date: Tue, 19 Mar 2013 14:10:35 +0900 [thread overview]
Message-ID: <87y5dkht4k.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <20130318144243.GA3351@ghostprotocols.net> (Arnaldo Carvalho de Melo's message of "Mon, 18 Mar 2013 11:42:43 -0300")
Hi Arnaldo,
On Mon, 18 Mar 2013 11:42:43 -0300, Arnaldo Carvalho de Melo wrote:
> Em Mon, Mar 18, 2013 at 11:41:47AM +0900, Namhyung Kim escreveu:
>> +static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
>> +{
>> + int i, err = -1;
>> + volatile int tmp = 0;
>> + u64 total_periods = 0;
>> + int nr_samples = 0;
>> + union perf_event *event;
>> + struct perf_evsel *evsel;
>> + struct perf_evlist *evlist;
>> + struct perf_event_attr attr = {
>> + .type = PERF_TYPE_SOFTWARE,
>> + .config = clock_id,
>> + .sample_type = PERF_SAMPLE_PERIOD,
>> + .exclude_kernel = 1,
>> + .disabled = 1,
>> + .freq = 1,
>> + .sample_freq = 10000,
>> + };
>
> In some compilers we get:
>
> tests/sw-clock.c: In function ‘__test__sw_clock_freq’:
> tests/sw-clock.c:35: error: unknown field ‘sample_freq’ specified in initializer
>
> So I'm moving the initialization to outside the struct named initialization block, i.e.:
>
> @@ -32,9 +32,10 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
> .exclude_kernel = 1,
> .disabled = 1,
> .freq = 1,
> - .sample_freq = 10000,
> };
>
> + attr.sample_freq = 10000;
> +
>
Thanks for fixing this!
Namhyung
next prev parent reply other threads:[~2013-03-19 5:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-18 2:41 [PATCH 1/2] perf: Reset hwc->last_period on sw clock events Namhyung Kim
2013-03-18 2:41 ` [PATCH 2/2] perf tests: Add a test case for checking sw clock event frequency Namhyung Kim
2013-03-18 14:42 ` Arnaldo Carvalho de Melo
2013-03-19 5:10 ` Namhyung Kim [this message]
2013-03-21 11:51 ` [tip:perf/core] " tip-bot for Namhyung Kim
2013-03-18 11:06 ` [tip:perf/urgent] perf: Reset hwc->last_period on sw clock events tip-bot for Namhyung Kim
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=87y5dkht4k.fsf@sejong.aot.lge.com \
--to=namhyung@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
/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