tracing/tools/latency-collector: Fix printf format warnings

- Use the printf format string with %s to take a string instead of taking
   in a string directly.
 -----BEGIN PGP SIGNATURE-----
 
 iIoEABYIADIWIQRRSw7ePDh/lE+zeZMp5XQQmuv6qgUCZk9YlBQccm9zdGVkdEBn
 b29kbWlzLm9yZwAKCRAp5XQQmuv6quTlAQDKX9sRQedTyMbldxgepZjiirDomfPk
 aMaZOXicdLJSswEAiNz9HxUd9mMaMb35Sf9wYrBXReO59FyrJCT34Fc6ZwQ=
 =PoMI
 -----END PGP SIGNATURE-----

Merge tag 'trace-tools-v6.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull tracing tool fix from Steven Rostedt:
 "Fix printf format warnings in latency-collector.

  Use the printf format string with %s to take a string instead of
  taking in a string directly"

* tag 'trace-tools-v6.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
  tools/latency-collector: Fix -Wformat-security compile warns
This commit is contained in:
Linus Torvalds 2024-05-23 12:32:15 -07:00
commit e82d2af501

View File

@ -935,12 +935,12 @@ static void show_available(void)
}
if (!tracers) {
warnx(no_tracer_msg);
warnx("%s", no_tracer_msg);
return;
}
if (!found) {
warnx(no_latency_tr_msg);
warnx("%s", no_latency_tr_msg);
tracefs_list_free(tracers);
return;
}
@ -983,7 +983,7 @@ static const char *find_default_tracer(void)
for (i = 0; relevant_tracers[i]; i++) {
valid = tracer_valid(relevant_tracers[i], &notracer);
if (notracer)
errx(EXIT_FAILURE, no_tracer_msg);
errx(EXIT_FAILURE, "%s", no_tracer_msg);
if (valid)
return relevant_tracers[i];
}
@ -1878,7 +1878,7 @@ static void scan_arguments(int argc, char *argv[])
}
valid = tracer_valid(current_tracer, &notracer);
if (notracer)
errx(EXIT_FAILURE, no_tracer_msg);
errx(EXIT_FAILURE, "%s", no_tracer_msg);
if (!valid)
errx(EXIT_FAILURE,
"The tracer %s is not supported by your kernel!\n", current_tracer);