perf tools: Initialize output buffer in build_id__sprintf
Jiri Olsa
reviewerPATCH 1/2 perf tools: Initialize output buffer in build_id__sprintf
We display garbage for undefined build_id objects, because we don't initialize the output buffer.
Signed-off-by Jiri Olsa <[email protected]>
--- tools/perf/util/build-id.c | 2 ++ 1 file changed, 2 insertions(+)
tools/perf/util/build-id.c +2 -0
@@ -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;
Signature · 1 line
2.26.2
Jiri Olsa
reviewerPATCH 2/2 perf tools: Add missing swap for ino_generation
We are missing swap for ino_generation field.
Fixes 5c5e854bc760 ("perf tools: Add attr->mmap2 support")
Signed-off-by Jiri Olsa <[email protected]>
--- tools/perf/util/session.c | 1 + 1 file changed, 1 insertion(+)
tools/perf/util/session.c +1 -0
@@ -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;
Signature · 1 line
2.26.2
Re: [PATCH 2/2] perf tools: Add missing swap for ino_generation
Quoted 5 lines · Jiri Olsa
We are missing swap for
ino_generationfield.Fixes 5c5e854bc760 ("perf tools: Add attr->mmap2 support")Signed-off-by Jiri Olsa <[email protected]>
Acked-by Namhyung Kim <[email protected]>
Thanks
Namhyung
Quoted 19 lines
--- tools/perf/util/session.c | 1 + 1 file changed, 1 insertion(+)tools/perf/util/session.c +1
-1@@ -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
Hi Jiri,
Quoted 5 lines · Jiri Olsa
We display garbage for undefined
build_idobjects, because we don't initialize the output buffer.Signed-off-by Jiri Olsa <[email protected]>
Acked-by Namhyung Kim <[email protected]>
Thanks
Namhyung
Quoted 20 lines
--- tools/perf/util/build-id.c | 2 ++ 1 file changed, 2 insertions(+)tools/perf/util/build-id.c +2
-1@@ -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
Em Mon, Nov 02, 2020 at 10:50:00PM +0900, Namhyung Kim escreveu:
Quoted 10 lines
Hi Jiri,
Quoted 5 lines · Jiri Olsa
We display garbage for undefined
build_idobjects, because we don't initialize the output buffer.Signed-off-by Jiri Olsa <[email protected]>Acked-by Namhyung Kim <[email protected]>
Thanks, applied.
- Arnaldo
Quoted 24 lines
Thanks
NamhyungQuoted 20 lines
--- tools/perf/util/build-id.c | 2 ++ 1 file changed, 2 insertions(+)tools/perf/util/build-id.c +2
-1@@ -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
Signature · 1 line
- Arnaldo