* [PATCH v1] perf inject: Fix use without initialization of local variables
@ 2024-12-11 6:08 Ian Rogers
2024-12-11 9:58 ` James Clark
0 siblings, 1 reply; 3+ messages in thread
From: Ian Rogers @ 2024-12-11 6:08 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, Kan Liang, linux-perf-users,
linux-kernel
Local variables were missing initialization and command line
processing didn't provide default values.
Fixes: 64eed019f3fc ("perf inject: Lazy build-id mmap2 event insertion")
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/builtin-inject.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index d6989195a061..11e49cafa3af 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -2367,10 +2367,10 @@ int cmd_inject(int argc, const char **argv)
};
int ret;
const char *known_build_ids = NULL;
- bool build_ids;
- bool build_id_all;
- bool mmap2_build_ids;
- bool mmap2_build_id_all;
+ bool build_ids = false;
+ bool build_id_all = false;
+ bool mmap2_build_ids = false;
+ bool mmap2_build_id_all = false;
struct option options[] = {
OPT_BOOLEAN('b', "build-ids", &build_ids,
--
2.47.1.613.gc27f4b7a9f-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v1] perf inject: Fix use without initialization of local variables
2024-12-11 6:08 [PATCH v1] perf inject: Fix use without initialization of local variables Ian Rogers
@ 2024-12-11 9:58 ` James Clark
2025-01-13 15:48 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 3+ messages in thread
From: James Clark @ 2024-12-11 9:58 UTC (permalink / raw)
To: Ian Rogers
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Adrian Hunter, Kan Liang, linux-perf-users, linux-kernel
On 11/12/2024 6:08 am, Ian Rogers wrote:
> Local variables were missing initialization and command line
> processing didn't provide default values.
>
> Fixes: 64eed019f3fc ("perf inject: Lazy build-id mmap2 event insertion")
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
> tools/perf/builtin-inject.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
> index d6989195a061..11e49cafa3af 100644
> --- a/tools/perf/builtin-inject.c
> +++ b/tools/perf/builtin-inject.c
> @@ -2367,10 +2367,10 @@ int cmd_inject(int argc, const char **argv)
> };
> int ret;
> const char *known_build_ids = NULL;
> - bool build_ids;
> - bool build_id_all;
> - bool mmap2_build_ids;
> - bool mmap2_build_id_all;
> + bool build_ids = false;
> + bool build_id_all = false;
> + bool mmap2_build_ids = false;
> + bool mmap2_build_id_all = false;
>
> struct option options[] = {
> OPT_BOOLEAN('b', "build-ids", &build_ids,
Reviewed-by: James Clark <james.clark@linaro.org>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v1] perf inject: Fix use without initialization of local variables
2024-12-11 9:58 ` James Clark
@ 2025-01-13 15:48 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2025-01-13 15:48 UTC (permalink / raw)
To: James Clark
Cc: Ian Rogers, Peter Zijlstra, Ingo Molnar, Namhyung Kim,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Adrian Hunter,
Kan Liang, linux-perf-users, linux-kernel
On Wed, Dec 11, 2024 at 09:58:00AM +0000, James Clark wrote:
> On 11/12/2024 6:08 am, Ian Rogers wrote:
> > Local variables were missing initialization and command line
> > processing didn't provide default values.
> >
> > Fixes: 64eed019f3fc ("perf inject: Lazy build-id mmap2 event insertion")
> > Signed-off-by: Ian Rogers <irogers@google.com>
> > ---
> > tools/perf/builtin-inject.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
> > index d6989195a061..11e49cafa3af 100644
> > --- a/tools/perf/builtin-inject.c
> > +++ b/tools/perf/builtin-inject.c
> > @@ -2367,10 +2367,10 @@ int cmd_inject(int argc, const char **argv)
> > };
> > int ret;
> > const char *known_build_ids = NULL;
> > - bool build_ids;
> > - bool build_id_all;
> > - bool mmap2_build_ids;
> > - bool mmap2_build_id_all;
> > + bool build_ids = false;
> > + bool build_id_all = false;
> > + bool mmap2_build_ids = false;
> > + bool mmap2_build_id_all = false;
> > struct option options[] = {
> > OPT_BOOLEAN('b', "build-ids", &build_ids,
>
> Reviewed-by: James Clark <james.clark@linaro.org>
Thanks, applied to perf-tools-next,
- Arnaldo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-13 15:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-11 6:08 [PATCH v1] perf inject: Fix use without initialization of local variables Ian Rogers
2024-12-11 9:58 ` James Clark
2025-01-13 15:48 ` 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