Linux Perf Users
 help / color / mirror / Atom feed
From: "Liang, Kan" <kan.liang@linux.intel.com>
To: James Clark <james.clark@arm.com>,
	linux-perf-users@vger.kernel.org, mark.rutland@arm.com,
	irogers@google.com
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Yang Jihong <yangjihong1@huawei.com>,
	Changbin Du <changbin.du@huawei.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf test: Fix session topology test on heterogeneous systems
Date: Mon, 22 Jan 2024 11:41:29 -0500	[thread overview]
Message-ID: <d4779b12-bb10-4957-a83d-8569f09421ff@linux.intel.com> (raw)
In-Reply-To: <20240122155436.185089-1-james.clark@arm.com>



On 2024-01-22 10:54 a.m., James Clark wrote:
> The test currently fails with this message when evlist__new_default()
> opens more than one event:
> 
>   32: Session topology                                                :
>   --- start ---
>   templ file: /tmp/perf-test-vv5YzZ
>   Using CPUID 0x00000000410fd070
>   Opening: unknown-hardware:HG
>   ------------------------------------------------------------
>   perf_event_attr:
>     type                             0 (PERF_TYPE_HARDWARE)
>     config                           0xb00000000
>     disabled                         1
>   ------------------------------------------------------------
>   sys_perf_event_open: pid 0  cpu -1  group_fd -1  flags 0x8 = 4
>   Opening: unknown-hardware:HG
>   ------------------------------------------------------------
>   perf_event_attr:
>     type                             0 (PERF_TYPE_HARDWARE)
>     config                           0xa00000000
>     disabled                         1
>   ------------------------------------------------------------
>   sys_perf_event_open: pid 0  cpu -1  group_fd -1  flags 0x8 = 5
>   non matching sample_type
>   FAILED tests/topology.c:73 can't get session
>   ---- end ----
>   Session topology: FAILED!
> 
> This is because when re-opening the file and parsing the header, Perf
> expects that any file that has more than one event has the session ID
> flag set. Perf record already sets the flag in a similar way when there
> is more than one event, so add the same logic to evlist__new_default().
> 
> evlist__new_default() is only currently used in tests, so I don't
> expect this change to have any other side effects.
> 
> The session topology test has been failing on Arm big.LITTLE platforms
> since commit 251aa040244a ("perf parse-events: Wildcard most
> "numeric" events") when evlist__new_default() started opening multiple
> events for 'cycles'.
> 
> Fixes: 251aa040244a ("perf parse-events: Wildcard most "numeric" events")
> Signed-off-by: James Clark <james.clark@arm.com>
Verified on an Intel hybrid machine.

Tested-by: Kan Liang <kan.liang@linux.intel.com>

Thanks,
Kan


> ---
>  tools/perf/util/evlist.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
> index 95f25e9fb994..56db37fac6f6 100644
> --- a/tools/perf/util/evlist.c
> +++ b/tools/perf/util/evlist.c
> @@ -95,6 +95,7 @@ struct evlist *evlist__new_default(void)
>  	struct evlist *evlist = evlist__new();
>  	bool can_profile_kernel;
>  	int err;
> +	struct evsel *evsel;
>  
>  	if (!evlist)
>  		return NULL;
> @@ -106,6 +107,10 @@ struct evlist *evlist__new_default(void)
>  		evlist = NULL;
>  	}
>  
> +	if (evlist->core.nr_entries > 1)
> +		evlist__for_each_entry(evlist, evsel)
> +			evsel__set_sample_id(evsel, false);
> +
>  	return evlist;
>  }
>  

  parent reply	other threads:[~2024-01-22 16:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22 15:54 [PATCH] perf test: Fix session topology test on heterogeneous systems James Clark
2024-01-22 15:58 ` James Clark
2024-01-22 16:41 ` Liang, Kan [this message]
2024-01-22 17:09 ` Ian Rogers
2024-01-23  0:09   ` Ian Rogers
2024-01-23 10:27 ` [PATCH v2] perf evlist: Fix evlist__new_default() for > 1 core PMU James Clark
2024-01-23 10:39   ` [PATCH v3] " James Clark
2024-01-24  0:46     ` Namhyung Kim
2024-01-24  9:03       ` James Clark
2024-01-26 16:25         ` Arnaldo Carvalho de Melo
2024-01-26 20:49           ` 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=d4779b12-bb10-4957-a83d-8569f09421ff@linux.intel.com \
    --to=kan.liang@linux.intel.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=changbin.du@huawei.com \
    --cc=irogers@google.com \
    --cc=james.clark@arm.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=yangjihong1@huawei.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