* [PATCH 0/2] perf intel-pt: Two small fixes for stable
@ 2023-04-03 15:48 Adrian Hunter
2023-04-03 15:48 ` [PATCH 1/2] perf auxtrace: Fix address filter entire kernel size Adrian Hunter
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Adrian Hunter @ 2023-04-03 15:48 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Jiri Olsa, Namhyung Kim, Ian Rogers, linux-kernel,
linux-perf-users
Hi
Here are 2 small fixes for stable.
Adrian Hunter (2):
perf auxtrace: Fix address filter entire kernel size
perf intel-pt: Fix CYC timestamps after standalone CBR
tools/perf/util/auxtrace.c | 5 ++++-
tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 2 ++
2 files changed, 6 insertions(+), 1 deletion(-)
Regards
Adrian
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] perf auxtrace: Fix address filter entire kernel size
2023-04-03 15:48 [PATCH 0/2] perf intel-pt: Two small fixes for stable Adrian Hunter
@ 2023-04-03 15:48 ` Adrian Hunter
2023-04-03 15:48 ` [PATCH 2/2] perf intel-pt: Fix CYC timestamps after standalone CBR Adrian Hunter
2023-04-03 18:26 ` [PATCH 0/2] perf intel-pt: Two small fixes for stable Arnaldo Carvalho de Melo
2 siblings, 0 replies; 4+ messages in thread
From: Adrian Hunter @ 2023-04-03 15:48 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Jiri Olsa, Namhyung Kim, Ian Rogers, linux-kernel,
linux-perf-users
kallsyms is not completely in address order.
In find_entire_kern_cb(), calculate the kernel end from the maximum
address not the last symbol.
Example:
Before:
$ sudo cat /proc/kallsyms | grep ' [twTw] ' | tail -1
ffffffffc00b8bd0 t bpf_prog_6deef7357e7b4530 [bpf]
$ sudo cat /proc/kallsyms | grep ' [twTw] ' | sort | tail -1
ffffffffc15e0cc0 t iwl_mvm_exit [iwlmvm]
$ perf.d093603a05aa record -v --kcore -e intel_pt// --filter 'filter *' -- uname |& grep filter
Address filter: filter 0xffffffff93200000/0x2ceba000
After:
$ perf.8fb0f7a01f8e record -v --kcore -e intel_pt// --filter 'filter *' -- uname |& grep filter
Address filter: filter 0xffffffff93200000/0x2e3e2000
Fixes: 1b36c03e3569 ("perf record: Add support for using symbols in address filters")
Cc: stable@vger.kernel.org
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
tools/perf/util/auxtrace.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
index 498ff7f24463..b2a5e5397bad 100644
--- a/tools/perf/util/auxtrace.c
+++ b/tools/perf/util/auxtrace.c
@@ -2449,6 +2449,7 @@ static int find_entire_kern_cb(void *arg, const char *name __maybe_unused,
char type, u64 start)
{
struct sym_args *args = arg;
+ u64 size;
if (!kallsyms__is_function(type))
return 0;
@@ -2458,7 +2459,9 @@ static int find_entire_kern_cb(void *arg, const char *name __maybe_unused,
args->start = start;
}
/* Don't know exactly where the kernel ends, so we add a page */
- args->size = round_up(start, page_size) + page_size - args->start;
+ size = round_up(start, page_size) + page_size - args->start;
+ if (size > args->size)
+ args->size = size;
return 0;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] perf intel-pt: Fix CYC timestamps after standalone CBR
2023-04-03 15:48 [PATCH 0/2] perf intel-pt: Two small fixes for stable Adrian Hunter
2023-04-03 15:48 ` [PATCH 1/2] perf auxtrace: Fix address filter entire kernel size Adrian Hunter
@ 2023-04-03 15:48 ` Adrian Hunter
2023-04-03 18:26 ` [PATCH 0/2] perf intel-pt: Two small fixes for stable Arnaldo Carvalho de Melo
2 siblings, 0 replies; 4+ messages in thread
From: Adrian Hunter @ 2023-04-03 15:48 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Jiri Olsa, Namhyung Kim, Ian Rogers, linux-kernel,
linux-perf-users
After a standalone CBR (not associated with TSC), update the cycles
reference timestamp and reset the cycle count, so that CYC timestamps are
calculated relative to that point with the new frequency.
Fixes: cc33618619ce ("perf tools: Add Intel PT support for decoding CYC packets")
Cc: stable@vger.kernel.org
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
index 0ac860c8dd2b..7145c5890de0 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
@@ -1998,6 +1998,8 @@ static void intel_pt_calc_cbr(struct intel_pt_decoder *decoder)
decoder->cbr = cbr;
decoder->cbr_cyc_to_tsc = decoder->max_non_turbo_ratio_fp / cbr;
+ decoder->cyc_ref_timestamp = decoder->timestamp;
+ decoder->cycle_cnt = 0;
intel_pt_mtc_cyc_cnt_cbr(decoder);
}
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] perf intel-pt: Two small fixes for stable
2023-04-03 15:48 [PATCH 0/2] perf intel-pt: Two small fixes for stable Adrian Hunter
2023-04-03 15:48 ` [PATCH 1/2] perf auxtrace: Fix address filter entire kernel size Adrian Hunter
2023-04-03 15:48 ` [PATCH 2/2] perf intel-pt: Fix CYC timestamps after standalone CBR Adrian Hunter
@ 2023-04-03 18:26 ` Arnaldo Carvalho de Melo
2 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-04-03 18:26 UTC (permalink / raw)
To: Adrian Hunter
Cc: Jiri Olsa, Namhyung Kim, Ian Rogers, linux-kernel,
linux-perf-users
Em Mon, Apr 03, 2023 at 06:48:29PM +0300, Adrian Hunter escreveu:
> Hi
>
> Here are 2 small fixes for stable.
>
>
> Adrian Hunter (2):
> perf auxtrace: Fix address filter entire kernel size
> perf intel-pt: Fix CYC timestamps after standalone CBR
Thanks, applied.
- Arnaldo
> tools/perf/util/auxtrace.c | 5 ++++-
> tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 2 ++
> 2 files changed, 6 insertions(+), 1 deletion(-)
>
>
> Regards
> Adrian
--
- Arnaldo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-04-03 18:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-03 15:48 [PATCH 0/2] perf intel-pt: Two small fixes for stable Adrian Hunter
2023-04-03 15:48 ` [PATCH 1/2] perf auxtrace: Fix address filter entire kernel size Adrian Hunter
2023-04-03 15:48 ` [PATCH 2/2] perf intel-pt: Fix CYC timestamps after standalone CBR Adrian Hunter
2023-04-03 18:26 ` [PATCH 0/2] perf intel-pt: Two small fixes for stable Arnaldo Carvalho de Melo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).