Re: perf tests: Fix attr tests size values interrupt

From: Arnaldo Carvalho de Melo
Date: Tue Dec 09 2014 - 09:29:42 EST


Em Tue, Dec 09, 2014 at 02:53:01PM +0100, Jiri Olsa escreveu:
> On Tue, Dec 09, 2014 at 11:39:47AM -0200, Arnaldo Carvalho de Melo wrote:
> > Em Tue, Dec 09, 2014 at 11:30:31AM -0200, Arnaldo Carvalho de Melo escreveu:
> > > Em Fri, Nov 21, 2014 at 07:26:31PM -0200, Arnaldo Carvalho de Melo escreveu:
> > > > Em Wed, Sep 24, 2014 at 01:48:37PM +0200, Stephane Eranian escreveu:
> > > > > This patch also adds a new ABI version
> > > > > PERF_ATTR_SIZE_VER4 because we extend
> > > > > the perf_event_attr struct with a new u64
> > > > > field.
> >
> > > I think this problem is also related to this changeset:
> >
> > > [root@zoo ~]# perf test -v 15
> > > 15: struct perf_event_attr setup :
> > <SNIP>
> > > running '/home/acme/libexec/perf-core/tests/attr/test-stat-default'
> > > expected size=96, got 104
> > > FAILED '/home/acme/libexec/perf-core/tests/attr/test-stat-default' -
> > > match failure
> > > test child finished with 0
> > > ---- end ----
> > > struct perf_event_attr setup: Ok
> > > [root@zoo ~]# uname -r
> > > 3.17.3-200.fc20.x86_64
> > > [root@zoo ~]#
> > >
> > > Checking if this is just a matter of updating the test entry.
> >
> > Well, here I think that size variable needs to somehow be tested against
> > the value of another field, the ABI one, so that for each ABI we test
> > against the rightsize, that is, after this cset, 8 bytes (sizeof u64)
> > bigger, Jiri?
>
> well this patch enlarged the perf_event_attr
> so the test needs to be adjusted like in patch below

Ok, got it, since the perf.data file is generated in the test, it will
have the current value, that now is 104, ok, applying your patch.

Thanks,

- Arnaldo

> [jolsa@krava perf]$ ./perf test attr -vv
> 15: struct perf_event_attr setup :
> --- start ---
> test child forked, pid 9719
> running './tests/attr/test-stat-group1'
> 'PERF_TEST_ATTR=/tmp/tmp4drvul ./perf stat -o /tmp/tmp4drvul/perf.data -e '{cycles,instructions}' kill >/dev/null 2>&1' ret 1
> expected size=96, got 104
> FAILED './tests/attr/test-stat-group1' - match failure
>
> jirka
>
>
> ---
> Following change adjusted 'struct perf_event_attr', but let
> the attr test's sizes untouched:
> 60e2364e60e8 perf: Add ability to sample machine state on interrupt
>
> Adjusting test size values for attr test.
>
> Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
> ---
> diff --git a/tools/perf/tests/attr/base-record b/tools/perf/tests/attr/base-record
> index f710b92ccff6..d3095dafed36 100644
> --- a/tools/perf/tests/attr/base-record
> +++ b/tools/perf/tests/attr/base-record
> @@ -5,7 +5,7 @@ group_fd=-1
> flags=0|8
> cpu=*
> type=0|1
> -size=96
> +size=104
> config=0
> sample_period=4000
> sample_type=263
> diff --git a/tools/perf/tests/attr/base-stat b/tools/perf/tests/attr/base-stat
> index dc3ada2470c0..872ed7e24c7c 100644
> --- a/tools/perf/tests/attr/base-stat
> +++ b/tools/perf/tests/attr/base-stat
> @@ -5,7 +5,7 @@ group_fd=-1
> flags=0|8
> cpu=*
> type=0
> -size=96
> +size=104
> config=0
> sample_period=0
> sample_type=0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/