perf/core: remove newline char in perf_event_sysfs_show
PATCH 1/1 perf/core: remove newline char in perf_event_sysfs_show
When a event also carries a event.unit file, having newline char will make perf userspace tool to print the event name in the next line when dumping counter data.
Cc Ingo Molnar <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Sukadev Bhattiprolu <[email protected]>
Cc Michael Ellerman <[email protected]>
Signed-off-by Madhavan Srinivasan <[email protected]>
--- kernel/events/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/core.c +1 -1
@@ -8982,7 +8982,7 @@ ssize_t perf_event_sysfs_show(struct device *dev, struct device_attribute *attr, container_of(attr, struct perf_pmu_events_attr, attr);if (pmu_attr->event_str) -return sprintf (page,"%s\n" , pmu_attr->event_str); +return sprintf (page,"%s" , pmu_attr->event_str);return 0 ; }
Signature · 1 line
1.9.1
Peter Zijlstra
maintainerQuoted 3 lines · Madhavan Srinivasan
When a event also carries a event.unit file, having newline char will make perf userspace tool to print the event name in the next line when dumping counter data.
And changing the kernel will break the API (it includes a '\n' now) so fix the tool.