Skip to contentSkip to conversation

perf: add support for logging debug messages to file

PATCH Superseded Changbin Du 3 participants 8 messages Oct 18, 2019 – Nov 25, 2019 perf events

v5 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v5 cover perf: add support for logging debug messages to file

When in TUI mode, it is impossible to show all the debug messages to console. This make it hard to debug perf issues using debug messages. This patch adds support for logging debug messages to file to resolve this problem.

v5:
o doc default log path.
v4:
o fix another segfault.
v3:
o fix a segfault issue.
v2:
o specific all debug options one time.

Changbin Du (2):
perf: support multiple debug options separated by ','
perf: add support for logging debug messages to file

 tools/perf/Documentation/perf.txt |  16 ++--
 tools/perf/util/debug.c           | 124 ++++++++++++++++++++----------
 2 files changed, 92 insertions(+), 48 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH v5 1/2 perf: support multiple debug options separated by ','

This patch adds support for multiple debug options separated by ',' and non-int values.
--debug verbose=2,stderr

---
 tools/perf/Documentation/perf.txt | 10 ++--
 tools/perf/util/debug.c           | 86 ++++++++++++++++---------------
 2 files changed, 50 insertions(+), 46 deletions(-)
tools/perf/Documentation/perf.txt +5 -5
index 401f0ed67439..c05a94b2488e 100644
@@ -19,11 +19,11 @@ OPTIONS
 	  --debug verbose=2 # sets verbose = 2
 
 	List of debug variables allowed to set:
-	  verbose          - general debug messages
-	  ordered-events   - ordered events object debug messages
-	  data-convert     - data convert command debug messages
-	  stderr           - write debug output (option -v) to stderr
-	                     in browser mode
+	  verbose=level		- general debug messages
+	  ordered-events=level	- ordered events object debug messages
+	  data-convert=level	- data convert command debug messages
+	  stderr		- write debug output (option -v) to stderr
+				  in browser mode
 
 --buildid-dir::
 	Setup buildid cache directory. It has higher priority than
tools/perf/util/debug.c +45 -41

113 lines not on this page · raw message

Signature · 1 line
2.20.1
#2 lore raw

PATCH v5 2/2 perf: add support for logging debug messages to file

In reply to Changbin Du

When in TUI mode, it is impossible to show all the debug messages to console. This make it hard to debug perf issues using debug messages. This patch adds support for logging debug messages to file to resolve this problem.

The usage is:
perf -debug verbose=2,file=~/perf.log COMMAND

---
v5: doc default log path.
v4: fix another segfault.
v3: fix a segfault issue.

---
 tools/perf/Documentation/perf.txt | 16 ++++++-----
 tools/perf/util/debug.c           | 44 ++++++++++++++++++++++++++++---
 2 files changed, 50 insertions(+), 10 deletions(-)
tools/perf/Documentation/perf.txt +10 -6
index c05a94b2488e..48376be3c97a 100644
@@ -16,14 +16,18 @@ OPTIONS
 	Setup debug variable (see list below) in value
 	range (0, 10). Use like:
 	  --debug verbose   # sets verbose = 1
-	  --debug verbose=2 # sets verbose = 2
+	  --debug verbose=2,file=~/perf.log
+	                    # sets verbose = 2 and save log to file
 
 	List of debug variables allowed to set:
-	  verbose=level		- general debug messages
-	  ordered-events=level	- ordered events object debug messages
-	  data-convert=level	- data convert command debug messages
-	  stderr		- write debug output (option -v) to stderr
-				  in browser mode
+	  verbose=level         - general debug messages
+	  ordered-events=level  - ordered events object debug messages
+	  data-convert=level    - data convert command debug messages
+	  stderr                - write debug output (option -v) to stderr
+	                          in browser mode
+	  file[=path]           - write debug output to log file, default
+	                          'perf.log' (stderr and file options are
+	                          exclusive)
 
 --buildid-dir::
 	Setup buildid cache directory. It has higher priority than
tools/perf/util/debug.c +40 -4

75 lines not on this page · raw message

Signature · 1 line
2.20.1
maintainer Acked-by on the v5 series
#3 lore raw
In reply to Changbin Du

Hello,

Quoted 5 lines · Changbin Du

When in TUI mode, it is impossible to show all the debug messages to console. This make it hard to debug perf issues using debug messages. This patch adds support for logging debug messages to file to resolve this problem.

I thought I implemented a debug message view in TUI mode by saving all the messages in a linked list. But it seems not sent to the list and I cannot find it now. :(

Anyway I understand your concerns and the changes look ok to me, so

Thanks
Namhyung

Quoted 21 lines

v5:
o doc default log path.
v4:
o fix another segfault.
v3:
o fix a segfault issue.
v2:
o specific all debug options one time.

Changbin Du (2):
perf: support multiple debug options separated by ','
perf: add support for logging debug messages to file

 tools/perf/Documentation/perf.txt |  16 ++--
 tools/perf/util/debug.c           | 124 ++++++++++++++++++++----------
 2 files changed, 92 insertions(+), 48 deletions(-)

--
2.20.1

#4 lore raw
Quoted 4 lines · Namhyung Kim

Hello,

Quoted 1 line · Changbin Du
Quoted 9 lines
Quoted 4 lines

When in TUI mode, it is impossible to show all the debug messages to console. This make it hard to debug perf issues using debug messages. This patch adds support for logging debug messages to file to resolve this problem.

I thought I implemented a debug message view in TUI mode by saving all the messages in a linked list. But it seems not sent to the list and I cannot find it now. :(

Sounds bad :)

Quoted 4 lines

Anyway I understand your concerns and the changes look ok to me, so

Thanks for your review.

#5 lore raw
In reply to Changbin Du

Hi Jiri, In case you missed this one in your mailbox. :)

Quoted 25 lines · Changbin Du

When in TUI mode, it is impossible to show all the debug messages to console. This make it hard to debug perf issues using debug messages. This patch adds support for logging debug messages to file to resolve this problem.

v5:
o doc default log path.
v4:
o fix another segfault.
v3:
o fix a segfault issue.
v2:
o specific all debug options one time.

Changbin Du (2):
perf: support multiple debug options separated by ','
perf: add support for logging debug messages to file

 tools/perf/Documentation/perf.txt |  16 ++--
 tools/perf/util/debug.c           | 124 ++++++++++++++++++++----------
 2 files changed, 92 insertions(+), 48 deletions(-)
Signature · 1 line
2.20.1
Signature · 2 lines
Cheers,
Changbin Du
#6 lore raw
Quoted 1 line · Changbin Du

Hi Jiri, In case you missed this one in your mailbox. :)

sry I mised this and can't apply this anymore.. could you please rebase it to current Arnaldo's perf/core?

thanks,
jirka

Quoted 32 lines · Changbin Du
Quoted 25 lines

When in TUI mode, it is impossible to show all the debug messages to console. This make it hard to debug perf issues using debug messages. This patch adds support for logging debug messages to file to resolve this problem.

v5:
o doc default log path.
v4:
o fix another segfault.
v3:
o fix a segfault issue.
v2:
o specific all debug options one time.

Changbin Du (2):
perf: support multiple debug options separated by ','
perf: add support for logging debug messages to file

 tools/perf/Documentation/perf.txt |  16 ++--
 tools/perf/util/debug.c           | 124 ++++++++++++++++++++----------
 2 files changed, 92 insertions(+), 48 deletions(-)
Signature · 1 line
2.20.1
Signature · 2 lines
Cheers,
Changbin Du
#7 lore raw
Quoted 6 lines · Jiri Olsa
Quoted 1 line · Changbin Du

Hi Jiri, In case you missed this one in your mailbox. :)

sry I mised this and can't apply this anymore.. could you please rebase it to current Arnaldo's perf/core?

no problem, please check it later.

Quoted 36 lines

thanks,
jirka

Quoted 32 lines · Changbin Du
Quoted 25 lines

When in TUI mode, it is impossible to show all the debug messages to console. This make it hard to debug perf issues using debug messages. This patch adds support for logging debug messages to file to resolve this problem.

v5:
o doc default log path.
v4:
o fix another segfault.
v3:
o fix a segfault issue.
v2:
o specific all debug options one time.

Changbin Du (2):
perf: support multiple debug options separated by ','
perf: add support for logging debug messages to file

 tools/perf/Documentation/perf.txt |  16 ++--
 tools/perf/util/debug.c           | 124 ++++++++++++++++++++----------
 2 files changed, 92 insertions(+), 48 deletions(-)
Signature · 1 line
2.20.1
Signature · 2 lines
Cheers,
Changbin Du
Signature · 2 lines
Cheers,
Changbin Du