linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]perf/core: remove newline char in perf_event_sysfs_show
@ 2015-05-28  9:29 Madhavan Srinivasan
  2015-05-28 11:32 ` Peter Zijlstra
  0 siblings, 1 reply; 2+ messages in thread
From: Madhavan Srinivasan @ 2015-05-28  9:29 UTC (permalink / raw)
  To: linux-kernel, linuxppc-dev
  Cc: Madhavan Srinivasan, Ingo Molnar, Jiri Olsa, Sukadev Bhattiprolu,
	Michael Ellerman

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@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Madhavan Srinivasan <maddy@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;
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH]perf/core: remove newline char in perf_event_sysfs_show
  2015-05-28  9:29 [PATCH]perf/core: remove newline char in perf_event_sysfs_show Madhavan Srinivasan
@ 2015-05-28 11:32 ` Peter Zijlstra
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Zijlstra @ 2015-05-28 11:32 UTC (permalink / raw)
  To: Madhavan Srinivasan
  Cc: linux-kernel, linuxppc-dev, Ingo Molnar, Jiri Olsa,
	Sukadev Bhattiprolu, Michael Ellerman

On Thu, May 28, 2015 at 02:59:26PM +0530, Madhavan Srinivasan wrote:
> 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-28 11:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-28  9:29 [PATCH]perf/core: remove newline char in perf_event_sysfs_show Madhavan Srinivasan
2015-05-28 11:32 ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).