Re: [PATCH 2/6] perf test: Use a test program in perf record tests

From: Namhyung Kim
Date: Wed Sep 07 2022 - 13:40:20 EST


On Wed, Sep 7, 2022 at 6:24 AM Adrian Hunter <adrian.hunter@xxxxxxxxx> wrote:
>
> On 7/09/22 16:16, Adrian Hunter wrote:
> > On 7/09/22 09:46, Namhyung Kim wrote:
> >> if ! perf record -o - --intr-regs=di,r8,dx,cx -e cpu/br_inst_retired.near_call/p \
> >> - -c 1000 --per-thread true 2> /dev/null \
> >> + -c 1000 --per-thread ${testopt} ${testprog} 2> /dev/null \
> >> | perf script -F ip,sym,iregs -i - 2> /dev/null \
> >
> > With the kernel patch:
> >
> > https://lore.kernel.org/lkml/20220711180706.3418612-1-kan.liang@xxxxxxxxxxxxxxx/
> >
> > I get:
> >
> > Samples for 'dummy:HG' event do not have IREGS attribute set. Cannot print 'iregs' field.
>
> We seem to need:

Yeah, I think we have a discussion already.

Thanks,
Namhyung


>
> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> index 13580a9c50b8d..959291903936a 100644
> --- a/tools/perf/builtin-script.c
> +++ b/tools/perf/builtin-script.c
> @@ -411,7 +411,7 @@ static int evsel__do_check_stype(struct evsel *evsel, u64 sample_type, const cha
> int type = output_type(attr->type);
> const char *evname;
>
> - if (attr->sample_type & sample_type)
> + if (evsel__is_dummy_event(evsel) || attr->sample_type & sample_type)
> return 0;
>
> if (output[type].user_set_fields & field) {
> diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh