Skip to contentSkip to conversation

perf record: Tweak "Lowering..." warning in record_opts__config_freq

PATCH Applied Hans-Peter Nilsson 2 participants 2 messages Dec 28, 2020 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf record: Tweak "Lowering..." warning in record_opts__config_freq

That is, instead of "Lowering default frequency rate to <F>" say "Lowering default frequency rate from <f> to <F>", specifying the overridden default frequency <f>, so you don't have to grep through the source to "remember" that was e.g. 4000.

Cc Peter Zijlstra <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Adrian Hunter <[email protected]>
Cc Kan Liang <[email protected]>
Cc Ian Rogers <[email protected]>
---
 tools/perf/util/record.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/util/record.c +2 -2
index 07e4b96a6625..3b38e7be10da 100644
@@ -202,10 +202,10 @@ static int record_opts__config_freq(struct record_opts *opts)
 	 * Default frequency is over current maximum.
 	 */
 	if (max_rate < opts->freq) {
-		pr_warning("Lowering default frequency rate to %u.\n"
+		pr_warning("Lowering default frequency rate from %u to %u.\n"
 			   "Please consider tweaking "
 			   "/proc/sys/kernel/perf_event_max_sample_rate.\n",
-			   max_rate);
+			   opts->freq, max_rate);
 		opts->freq = max_rate;
 	}
 
Signature · 3 lines
2.11.0

brgds, H-P
maintainer Applied
#1 lore raw

Em Mon, Dec 28, 2020 at 04:19:08AM +0100, Hans-Peter Nilsson escreveu:

Quoted 4 lines

That is, instead of "Lowering default frequency rate to <F>" say "Lowering default frequency rate from <f> to <F>", specifying the overridden default frequency <f>, so you don't have to grep through the source to "remember" that was e.g. 4000.

Thanks, applied.

- Arnaldo

Quoted 36 lines
Cc Peter Zijlstra <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Adrian Hunter <[email protected]>
Cc Kan Liang <[email protected]>
Cc Ian Rogers <[email protected]>
---
 tools/perf/util/record.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/util/record.c +2 -2
index 07e4b96a6625..3b38e7be10da 100644
@@ -202,10 +202,10 @@ static int record_opts__config_freq(struct record_opts *opts)
 	 * Default frequency is over current maximum.
 	 */
 	if (max_rate < opts->freq) {
-		pr_warning("Lowering default frequency rate to %u.\n"
+		pr_warning("Lowering default frequency rate from %u to %u.\n"
 			   "Please consider tweaking "
 			   "/proc/sys/kernel/perf_event_max_sample_rate.\n",
-			   max_rate);
+			   opts->freq, max_rate);
 		opts->freq = max_rate;
 	}
 
Signature · 3 lines
2.11.0

brgds, H-P
Signature · 1 line
- Arnaldo