From: Jiri Olsa <olsajiri@gmail.com>
To: Hongtao Yu <hoy@fb.com>
Cc: "linux-perf-users@vger.kernel.org" <linux-perf-users@vger.kernel.org>
Subject: Re: Cannot print 'uregs' field with perf script -F uregs
Date: Mon, 15 Aug 2022 09:14:21 +0200 [thread overview]
Message-ID: <YvnyTc5q91d2RpQi@krava> (raw)
In-Reply-To: <MW3PR15MB3868A1461BB93AC91C242B0CCF689@MW3PR15MB3868.namprd15.prod.outlook.com>
On Mon, Aug 15, 2022 at 04:22:57AM +0000, Hongtao Yu wrote:
> Hi,
>
> I was seeing an issue with “perf script -F uregs”:
>
> Samples for 'dummy:HG' event do not have UREGS attribute set. Cannot print 'uregs' field.
>
> This seems to only happen to a perf.data resulted from a system-wide monitoring, e.g “perf record -a”. Per-process monitoring works fine. By search up online I see a thread that could be relevant: https://lore.kernel.org/all/YVNq9av%2F3Lwmom4T@krava/
>
> Can someone please shed a light whether this is an issue with perf, or something wrong with my perf.data?
>
>
> Thanks,
> Hongtao
>
>
hum, I thought we already fixed this.. would fix below work for you?
thanks,
jirka
---
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 13580a9c50b8..30c9cbdee98d 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -451,6 +451,9 @@ static int evsel__check_attr(struct evsel *evsel, struct perf_session *session)
allow_user_set = perf_header__has_feat(&session->header,
HEADER_AUXTRACE);
+ if (evsel__is_dummy_event(evsel))
+ allow_user_set = true;
+
if (PRINT_FIELD(TRACE) &&
!perf_session__has_traces(session, "record -R"))
return -EINVAL;
@@ -517,7 +520,7 @@ static int evsel__check_attr(struct evsel *evsel, struct perf_session *session)
return -EINVAL;
if (PRINT_FIELD(UREGS) &&
- evsel__check_stype(evsel, PERF_SAMPLE_REGS_USER, "UREGS", PERF_OUTPUT_UREGS))
+ evsel__do_check_stype(evsel, PERF_SAMPLE_REGS_USER, "UREGS", PERF_OUTPUT_UREGS, allow_user_set))
return -EINVAL;
if (PRINT_FIELD(PHYS_ADDR) &&
next prev parent reply other threads:[~2022-08-15 7:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-15 4:22 Cannot print 'uregs' field with perf script -F uregs Hongtao Yu
2022-08-15 7:14 ` Jiri Olsa [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-08-16 5:34 Hongtao Yu
2022-08-29 12:29 ` Jiri Olsa
2022-08-29 16:24 ` Hongtao Yu
2022-08-29 22:12 ` Jiri Olsa
2022-08-29 23:29 ` Hongtao Yu
2022-08-29 22:38 ` 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=YvnyTc5q91d2RpQi@krava \
--to=olsajiri@gmail.com \
--cc=hoy@fb.com \
--cc=linux-perf-users@vger.kernel.org \
/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