All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf record: Change warning for missing sysfs entry to debug
@ 2018-04-12 13:32 Thomas Richter
  2018-04-12 17:22 ` Arnaldo Carvalho de Melo
  2018-04-16  6:47 ` [tip:perf/urgent] " tip-bot for Thomas Richter
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Richter @ 2018-04-12 13:32 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users, acme
  Cc: brueckner, schwidefsky, heiko.carstens, Thomas Richter

Using perf on 4.16.0 kernel on s390 shows warning
   failed: can't open node sysfs data
each time I run command perf record ... for example:

[root@s35lp76 perf]# ./perf record -e rB0000 -- sleep 1
[ perf record: Woken up 1 times to write data ]
failed: can't open node sysfs data
[ perf record: Captured and wrote 0.001 MB perf.data (4 samples) ]
[root@s35lp76 perf]#

It turns out commit e2091cedd51bf ("perf tools: Add MEM_TOPOLOGY
feature to perf data file") tries to open directory named
/sys/devices/system/node/ which does not exist on s390.

This is the call stack:
 __cmd_record
 +---> perf_session__write_header
       +---> perf_header__adds_write
             +---> do_write_feat
	           +---> write_mem_topology
		         +---> build_mem_topology
			       prints warning
The issue starts in do_write_feat() which unconditionally
loops over all features and now includes HEADER_MEM_TOPOLOGY and calls
write_mem_topology().
Function record__init_features() at the beginning of __cmd_record()
sets all features and then turns off some of them.

Fix this by changing the warning to a level 2 debug output statement.
So it is only shown when debug level 2 or higher is set.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
---
 tools/perf/util/header.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 121df1683c36..a8bff2178fbc 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1320,7 +1320,8 @@ static int build_mem_topology(struct memory_node *nodes, u64 size, u64 *cntp)
 
 	dir = opendir(path);
 	if (!dir) {
-		pr_warning("failed: can't open node sysfs data\n");
+		pr_debug2("%s: could't read %s, does this arch have topology information?\n",
+			  __func__, path);
 		return -1;
 	}
 
-- 
2.14.3

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

* Re: [PATCH] perf record: Change warning for missing sysfs entry to debug
  2018-04-12 13:32 [PATCH] perf record: Change warning for missing sysfs entry to debug Thomas Richter
@ 2018-04-12 17:22 ` Arnaldo Carvalho de Melo
  2018-04-16  6:47 ` [tip:perf/urgent] " tip-bot for Thomas Richter
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2018-04-12 17:22 UTC (permalink / raw)
  To: Thomas Richter
  Cc: linux-kernel, linux-perf-users, brueckner, schwidefsky, heiko.carstens

Em Thu, Apr 12, 2018 at 03:32:46PM +0200, Thomas Richter escreveu:
> Using perf on 4.16.0 kernel on s390 shows warning
>    failed: can't open node sysfs data
> each time I run command perf record ... for example:

Thanks, applied.

- Arnaldo

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

* [tip:perf/urgent] perf record: Change warning for missing sysfs entry to debug
  2018-04-12 13:32 [PATCH] perf record: Change warning for missing sysfs entry to debug Thomas Richter
  2018-04-12 17:22 ` Arnaldo Carvalho de Melo
@ 2018-04-16  6:47 ` tip-bot for Thomas Richter
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Thomas Richter @ 2018-04-16  6:47 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, brueckner, heiko.carstens, tmricht, tglx,
	acme, mingo, schwidefsky

Commit-ID:  4f75f1cbf95e2f0853cd229d042b203931b899af
Gitweb:     https://git.kernel.org/tip/4f75f1cbf95e2f0853cd229d042b203931b899af
Author:     Thomas Richter <tmricht@linux.ibm.com>
AuthorDate: Thu, 12 Apr 2018 15:32:46 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 13 Apr 2018 09:59:56 -0300

perf record: Change warning for missing sysfs entry to debug

Using perf on 4.16.0 kernel on s390 shows this warning:

   failed: can't open node sysfs data

each time I run command perf record ... for example:

  [root@s35lp76 perf]# ./perf record -e rB0000 -- sleep 1
  [ perf record: Woken up 1 times to write data ]
  failed: can't open node sysfs data
  [ perf record: Captured and wrote 0.001 MB perf.data (4 samples) ]
  [root@s35lp76 perf]#

It turns out commit e2091cedd51bf ("perf tools: Add MEM_TOPOLOGY feature
to perf data file") tries to open directory named /sys/devices/system/node/
which does not exist on s390.

This is the call stack:
 __cmd_record
 +---> perf_session__write_header
       +---> perf_header__adds_write
             +---> do_write_feat
	           +---> write_mem_topology
		         +---> build_mem_topology
			       prints warning

The issue starts in do_write_feat() which unconditionally loops over all
features and now includes HEADER_MEM_TOPOLOGY and calls write_mem_topology().

Function record__init_features() at the beginning of __cmd_record() sets
all features and then turns off some of them.

Fix this by changing the warning to a level 2 debug output statement.

So it is only shown when debug level 2 or higher is set.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Link: http://lkml.kernel.org/r/20180412133246.92801-1-tmricht@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/header.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 121df1683c36..a8bff2178fbc 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1320,7 +1320,8 @@ static int build_mem_topology(struct memory_node *nodes, u64 size, u64 *cntp)
 
 	dir = opendir(path);
 	if (!dir) {
-		pr_warning("failed: can't open node sysfs data\n");
+		pr_debug2("%s: could't read %s, does this arch have topology information?\n",
+			  __func__, path);
 		return -1;
 	}
 

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

end of thread, other threads:[~2018-04-16  6:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-12 13:32 [PATCH] perf record: Change warning for missing sysfs entry to debug Thomas Richter
2018-04-12 17:22 ` Arnaldo Carvalho de Melo
2018-04-16  6:47 ` [tip:perf/urgent] " tip-bot for Thomas Richter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.