[PATCH]perf/core: remove newline char in perf_event_sysfs_show

Madhavan Srinivasan maddy at linux.vnet.ibm.com
Thu May 28 19:29:26 AEST 2015

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 <mingo at kernel.org>
Cc: Jiri Olsa <jolsa at redhat.com>
Cc: Sukadev Bhattiprolu <sukadev at linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe at ellerman.id.au>
Signed-off-by: Madhavan Srinivasan <maddy at linux.vnet.ibm.com>
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 1a3bf48..3b5a372 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -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;

More information about the Linuxppc-dev mailing list