From: Namhyung Kim <namhyung@kernel.org>
To: "Chen, Zide" <zide.chen@intel.com>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Ingo Molnar <mingo@redhat.com>, Jiri Olsa <jolsa@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Ian Rogers <irogers@google.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
thomas.falcon@intel.com, dapeng1.mi@linux.intel.com,
xudong.hao@intel.com
Subject: Re: [PATCH] perf tools: Refactor precise_ip fallback logic
Date: Tue, 11 Nov 2025 11:34:04 -0800 [thread overview]
Message-ID: <aROPrA02BU1uafrD@google.com> (raw)
In-Reply-To: <42bafd4d-ff6e-4529-95f7-9c4c963fc49c@intel.com>
On Tue, Nov 11, 2025 at 11:11:45AM -0800, Chen, Zide wrote:
>
>
> On 11/10/2025 11:50 PM, Namhyung Kim wrote:
> > On Fri, Nov 07, 2025 at 02:31:23PM -0800, Chen, Zide wrote:
> >>
> >>
> >> On 11/7/2025 1:42 PM, Namhyung Kim wrote:
> >>> On Thu, Nov 06, 2025 at 05:23:09PM -0800, Chen, Zide wrote:
> >>>>
> >>>>
> >>>> On 11/6/2025 10:52 AM, Namhyung Kim wrote:
> >>> Can you run these commands and show the output here?
> >>>
> >>> $ perf record -e task-clock:S true
> >>> $ perf evlist -v
> >>
> >> On 6.18.0-rc4:
> >>
> >> $ perf record -e task-clock:S true
> >> [ perf record: Woken up 2 times to write data ]
> >> [ perf record: Captured and wrote 0.006 MB perf.data ]
> >>
> >> $ perf evlist -v
> >> task-clock:Su: type: 1 (PERF_TYPE_SOFTWARE), size: 136, config: 0x1
> >> (PERF_COUNT_SW_TASK_CLOCK), { sample_period, sample_freq }: 4000,
> >> sample_type: IP|TID|TIME|READ|ID|PERIOD, read_format: ID|LOST, disabled:
> >> 1, inherit: 1, exclude_kernel: 1, exclude_hv: 1, mmap: 1, comm: 1, freq:
> >> 1, enable_on_exec: 1, task: 1, sample_id_all: 1, mmap2: 1, comm_exec: 1,
> >> ksymbol: 1, bpf_event: 1, build_id: 1
> >
> > Thanks for sharing this. Yep, it has the inherit bit.
> >
> > I think there's a bug in the missing feature test. Indeed, it should
> > also have PERF_SAMPLE_TID for the test according to the kernel comment.
> >
> > /*
> > * We do not support PERF_SAMPLE_READ on inherited events unless
> > * PERF_SAMPLE_TID is also selected, which allows inherited events to
> > * collect per-thread samples.
> > * See perf_output_read().
> > */
> > if (has_inherit_and_sample_read(attr) && !(attr->sample_type & PERF_SAMPLE_TID))
> > return ERR_PTR(-EINVAL);
>
> It seems that the purpose of the inherit_sample_read fallback is to
> remove the inherit attribute when both PERF_SAMPLE_READ and inherit are
> present, but PERF_SAMPLE_TID is not. The new change may not be able to
> accomplish this?
No, the purpose of the missing feature check is to detect whether the
current kernel supports this feature or not. The correct check should
pass both READ and TID together.
Thanks,
Namhyung
next prev parent reply other threads:[~2025-11-11 19:34 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-22 22:08 [PATCH] perf tools: Refactor precise_ip fallback logic Zide Chen
2025-10-23 16:14 ` Ian Rogers
2025-10-23 22:11 ` Chen, Zide
2026-02-06 22:06 ` Arnaldo Carvalho de Melo
2026-02-06 22:10 ` Arnaldo Carvalho de Melo
2025-10-24 2:30 ` Namhyung Kim
2025-10-24 18:03 ` Chen, Zide
2025-10-26 0:42 ` Namhyung Kim
2025-10-27 18:56 ` Chen, Zide
2025-11-04 3:48 ` Namhyung Kim
2025-11-04 19:10 ` Chen, Zide
2025-11-06 18:52 ` Namhyung Kim
2025-11-07 1:23 ` Chen, Zide
2025-11-07 21:42 ` Namhyung Kim
2025-11-07 22:31 ` Chen, Zide
2025-11-11 7:50 ` Namhyung Kim
2025-11-11 19:11 ` Chen, Zide
2025-11-11 19:34 ` Namhyung Kim [this message]
2025-11-11 20:01 ` Chen, Zide
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=aROPrA02BU1uafrD@google.com \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=dapeng1.mi@linux.intel.com \
--cc=irogers@google.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=peterz@infradead.org \
--cc=thomas.falcon@intel.com \
--cc=xudong.hao@intel.com \
--cc=zide.chen@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.