lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 18 Mar 2013 11:42:43 -0300
From:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
To:	Namhyung Kim <namhyung@...nel.org>
Cc:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Ingo Molnar <mingo@...nel.org>, Jiri Olsa <jolsa@...hat.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Namhyung Kim <namhyung.kim@....com>
Subject: Re: [PATCH 2/2] perf tests: Add a test case for checking sw clock
 event frequency

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;
+

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ