* [PATCH 1/2] perf tools: Initialize output buffer in build_id__sprintf
@ 2020-11-01 23:31 Jiri Olsa
2020-11-01 23:31 ` [PATCH 2/2] perf tools: Add missing swap for ino_generation Jiri Olsa
2020-11-02 13:50 ` [PATCH 1/2] perf tools: Initialize output buffer in build_id__sprintf Namhyung Kim
0 siblings, 2 replies; 5+ messages in thread
From: Jiri Olsa @ 2020-11-01 23:31 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: lkml, Peter Zijlstra, Ingo Molnar, Mark Rutland, Namhyung Kim,
Alexander Shishkin, Michael Petlan, Ian Rogers, Stephane Eranian
We display garbage for undefined build_id objects,
because we don't initialize the output buffer.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/util/build-id.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
index 8763772f1095..6b410c3d52dc 100644
--- a/tools/perf/util/build-id.c
+++ b/tools/perf/util/build-id.c
@@ -102,6 +102,8 @@ int build_id__sprintf(const struct build_id *build_id, char *bf)
const u8 *raw = build_id->data;
size_t i;
+ bf[0] = 0x0;
+
for (i = 0; i < build_id->size; ++i) {
sprintf(bid, "%02x", *raw);
++raw;
--
2.26.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] perf tools: Add missing swap for ino_generation
2020-11-01 23:31 [PATCH 1/2] perf tools: Initialize output buffer in build_id__sprintf Jiri Olsa
@ 2020-11-01 23:31 ` Jiri Olsa
2020-11-02 13:50 ` Namhyung Kim
2020-11-02 13:50 ` [PATCH 1/2] perf tools: Initialize output buffer in build_id__sprintf Namhyung Kim
1 sibling, 1 reply; 5+ messages in thread
From: Jiri Olsa @ 2020-11-01 23:31 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: lkml, Peter Zijlstra, Ingo Molnar, Mark Rutland, Namhyung Kim,
Alexander Shishkin, Michael Petlan, Ian Rogers, Stephane Eranian
We are missing swap for ino_generation field.
Fixes: 5c5e854bc760 ("perf tools: Add attr->mmap2 support")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/util/session.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 7a5f03764702..d20b16ee7377 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -595,6 +595,7 @@ static void perf_event__mmap2_swap(union perf_event *event,
event->mmap2.maj = bswap_32(event->mmap2.maj);
event->mmap2.min = bswap_32(event->mmap2.min);
event->mmap2.ino = bswap_64(event->mmap2.ino);
+ event->mmap2.ino_generation = bswap_64(event->mmap2.ino_generation);
if (sample_id_all) {
void *data = &event->mmap2.filename;
--
2.26.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] perf tools: Initialize output buffer in build_id__sprintf
2020-11-01 23:31 [PATCH 1/2] perf tools: Initialize output buffer in build_id__sprintf Jiri Olsa
2020-11-01 23:31 ` [PATCH 2/2] perf tools: Add missing swap for ino_generation Jiri Olsa
@ 2020-11-02 13:50 ` Namhyung Kim
2020-11-03 12:15 ` Arnaldo Carvalho de Melo
1 sibling, 1 reply; 5+ messages in thread
From: Namhyung Kim @ 2020-11-02 13:50 UTC (permalink / raw)
To: Jiri Olsa
Cc: Arnaldo Carvalho de Melo, lkml, Peter Zijlstra, Ingo Molnar,
Mark Rutland, Alexander Shishkin, Michael Petlan, Ian Rogers,
Stephane Eranian
Hi Jiri,
On Mon, Nov 2, 2020 at 8:31 AM Jiri Olsa <jolsa@kernel.org> wrote:
>
> We display garbage for undefined build_id objects,
> because we don't initialize the output buffer.
>
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Thanks
Namhyung
> ---
> tools/perf/util/build-id.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
> index 8763772f1095..6b410c3d52dc 100644
> --- a/tools/perf/util/build-id.c
> +++ b/tools/perf/util/build-id.c
> @@ -102,6 +102,8 @@ int build_id__sprintf(const struct build_id *build_id, char *bf)
> const u8 *raw = build_id->data;
> size_t i;
>
> + bf[0] = 0x0;
> +
> for (i = 0; i < build_id->size; ++i) {
> sprintf(bid, "%02x", *raw);
> ++raw;
> --
> 2.26.2
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] perf tools: Add missing swap for ino_generation
2020-11-01 23:31 ` [PATCH 2/2] perf tools: Add missing swap for ino_generation Jiri Olsa
@ 2020-11-02 13:50 ` Namhyung Kim
0 siblings, 0 replies; 5+ messages in thread
From: Namhyung Kim @ 2020-11-02 13:50 UTC (permalink / raw)
To: Jiri Olsa
Cc: Arnaldo Carvalho de Melo, lkml, Peter Zijlstra, Ingo Molnar,
Mark Rutland, Alexander Shishkin, Michael Petlan, Ian Rogers,
Stephane Eranian
On Mon, Nov 2, 2020 at 8:31 AM Jiri Olsa <jolsa@kernel.org> wrote:
>
> We are missing swap for ino_generation field.
>
> Fixes: 5c5e854bc760 ("perf tools: Add attr->mmap2 support")
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Thanks
Namhyung
> ---
> tools/perf/util/session.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
> index 7a5f03764702..d20b16ee7377 100644
> --- a/tools/perf/util/session.c
> +++ b/tools/perf/util/session.c
> @@ -595,6 +595,7 @@ static void perf_event__mmap2_swap(union perf_event *event,
> event->mmap2.maj = bswap_32(event->mmap2.maj);
> event->mmap2.min = bswap_32(event->mmap2.min);
> event->mmap2.ino = bswap_64(event->mmap2.ino);
> + event->mmap2.ino_generation = bswap_64(event->mmap2.ino_generation);
>
> if (sample_id_all) {
> void *data = &event->mmap2.filename;
> --
> 2.26.2
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] perf tools: Initialize output buffer in build_id__sprintf
2020-11-02 13:50 ` [PATCH 1/2] perf tools: Initialize output buffer in build_id__sprintf Namhyung Kim
@ 2020-11-03 12:15 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-11-03 12:15 UTC (permalink / raw)
To: Namhyung Kim
Cc: Jiri Olsa, lkml, Peter Zijlstra, Ingo Molnar, Mark Rutland,
Alexander Shishkin, Michael Petlan, Ian Rogers, Stephane Eranian
Em Mon, Nov 02, 2020 at 10:50:00PM +0900, Namhyung Kim escreveu:
> Hi Jiri,
>
> On Mon, Nov 2, 2020 at 8:31 AM Jiri Olsa <jolsa@kernel.org> wrote:
> >
> > We display garbage for undefined build_id objects,
> > because we don't initialize the output buffer.
> >
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
>
> Acked-by: Namhyung Kim <namhyung@kernel.org>
Thanks, applied.
- Arnaldo
> Thanks
> Namhyung
>
>
> > ---
> > tools/perf/util/build-id.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
> > index 8763772f1095..6b410c3d52dc 100644
> > --- a/tools/perf/util/build-id.c
> > +++ b/tools/perf/util/build-id.c
> > @@ -102,6 +102,8 @@ int build_id__sprintf(const struct build_id *build_id, char *bf)
> > const u8 *raw = build_id->data;
> > size_t i;
> >
> > + bf[0] = 0x0;
> > +
> > for (i = 0; i < build_id->size; ++i) {
> > sprintf(bid, "%02x", *raw);
> > ++raw;
> > --
> > 2.26.2
> >
--
- Arnaldo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-11-03 12:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-01 23:31 [PATCH 1/2] perf tools: Initialize output buffer in build_id__sprintf Jiri Olsa
2020-11-01 23:31 ` [PATCH 2/2] perf tools: Add missing swap for ino_generation Jiri Olsa
2020-11-02 13:50 ` Namhyung Kim
2020-11-02 13:50 ` [PATCH 1/2] perf tools: Initialize output buffer in build_id__sprintf Namhyung Kim
2020-11-03 12:15 ` 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).