From: Peter Zijlstra <peterz@infradead•org>
To: Yonghong Song <yhs@fb•com>
Cc: rostedt@goodmis•org, ast@fb•com, daniel@iogearbox•net,
netdev@vger•kernel.org, kernel-team@fb•com
Subject: Re: [PATCH net-next 1/4] bpf: add helper bpf_perf_read_counter_time for perf event array map
Date: Fri, 1 Sep 2017 22:41:09 +0200 [thread overview]
Message-ID: <20170901204109.GT6524@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <20170901165357.465121-2-yhs@fb.com>
On Fri, Sep 01, 2017 at 09:53:54AM -0700, Yonghong Song wrote:
> diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
> index b14095b..7fd5e94 100644
> --- a/include/linux/perf_event.h
> +++ b/include/linux/perf_event.h
> @@ -901,6 +901,8 @@ extern void perf_pmu_migrate_context(struct pmu *pmu,
> int perf_event_read_local(struct perf_event *event, u64 *value);
> extern u64 perf_event_read_value(struct perf_event *event,
> u64 *enabled, u64 *running);
> +extern void calc_timer_values(struct perf_event *event, u64 *now,
> + u64 *enabled, u64 *running);
>
>
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 8c01572..ef5c7fb 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -4883,7 +4883,7 @@ static int perf_event_index(struct perf_event *event)
> return event->pmu->event_idx(event);
> }
>
> -static void calc_timer_values(struct perf_event *event,
> +void calc_timer_values(struct perf_event *event,
> u64 *now,
> u64 *enabled,
> u64 *running)
Yeah, not going to happen...
Why not do the obvious thing and extend perf_event_read_local() to
optionally return the enabled/running times?
next prev parent reply other threads:[~2017-09-01 20:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-01 16:53 [PATCH net-next 0/4] bpf: add two helpers to read perf event enabled/running time Yonghong Song
2017-09-01 16:53 ` [PATCH net-next 1/4] bpf: add helper bpf_perf_read_counter_time for perf event array map Yonghong Song
2017-09-01 20:29 ` Alexei Starovoitov
2017-09-01 20:50 ` Peter Zijlstra
2017-09-01 21:01 ` Yonghong Song
2017-09-01 20:41 ` Peter Zijlstra [this message]
2017-09-01 16:53 ` [PATCH net-next 2/4] bpf: add a test case for helper bpf_perf_read_counter_time Yonghong Song
2017-09-01 16:53 ` [PATCH net-next 3/4] bpf: add helper bpf_perf_prog_read_time Yonghong Song
2017-09-01 16:53 ` [PATCH net-next 4/4] bpf: add a test case for " Yonghong Song
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=20170901204109.GT6524@worktop.programming.kicks-ass.net \
--to=peterz@infradead$(echo .)org \
--cc=ast@fb$(echo .)com \
--cc=daniel@iogearbox$(echo .)net \
--cc=kernel-team@fb$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=rostedt@goodmis$(echo .)org \
--cc=yhs@fb$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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