Skip to contentSkip to conversation

perf python scripting: Append examples to err msg about audit-libs-python

PATCH In review Taeung Song 3 participants 4 messages Feb 9, 2016 – Feb 16, 2016 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf python scripting: Append examples to err msg about audit-libs-python

To print the syscall name, the audit-libs-python package should be required. If not installed, print
the erron string e.g.

    # perf script syscall-counts
    Install the audit-libs-python package to get syscall names.

But the package name is different in Ubuntu
so append examples the erron string like below. (similar to a error message of util/trace-event-scripting.c)

    # perf script syscall-counts
    Install the audit-libs-python package to get syscall names.
    For example:
      # apt-get install python-audit (Ubuntu)
      # yum install audit-libs-python (Fedora)
      etc.
---
 tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py +4 -1
index 15c8400..1d95009 100644
@@ -71,7 +71,10 @@ try:
 except:
 	if not audit_package_warned:
 		audit_package_warned = True
-		print "Install the audit-libs-python package to get syscall names"
+		print "Install the audit-libs-python package to get syscall names.\n" \
+                    "For example:\n  # apt-get install python-audit (Ubuntu)" \
+                    "\n  # yum install audit-libs-python (Fedora)" \
+                    "\n  etc.\n"
 
 def syscall_name(id):
 	try:
Signature · 1 line
2.5.0
#1 lore raw

Em Tue, Feb 09, 2016 at 08:53:10PM +0900, Taeung Song escreveu:

Quoted 3 lines

To print the syscall name, the audit-libs-python package should be required. If not installed, print
the erron string e.g.

After fixing spelling mistakes, applied, thanks,

- Arnaldo

Quoted 38 lines
    # perf script syscall-counts
    Install the audit-libs-python package to get syscall names.

But the package name is different in Ubuntu
so append examples the erron string like below. (similar to a error message of util/trace-event-scripting.c)

    # perf script syscall-counts
    Install the audit-libs-python package to get syscall names.
    For example:
      # apt-get install python-audit (Ubuntu)
      # yum install audit-libs-python (Fedora)
      etc.
---
 tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py +4 -1
index 15c8400..1d95009 100644
@@ -71,7 +71,10 @@ try:
 except:
 	if not audit_package_warned:
 		audit_package_warned = True
-		print "Install the audit-libs-python package to get syscall names"
+		print "Install the audit-libs-python package to get syscall names.\n" \
+                    "For example:\n  # apt-get install python-audit (Ubuntu)" \
+                    "\n  # yum install audit-libs-python (Fedora)" \
+                    "\n  etc.\n"
 
 def syscall_name(id):
 	try:
Signature · 1 line
2.5.0
#2 lore raw

Hi, Arnaldo

Quoted 8 lines · Arnaldo Carvalho de Melo

Em Tue, Feb 09, 2016 at 08:53:10PM +0900, Taeung Song escreveu:

Quoted 3 lines

To print the syscall name, the audit-libs-python package should be required. If not installed, print
the erron string e.g.

After fixing spelling mistakes, applied, thanks,

- Arnaldo

Thank you !! :)

Taeung

#3 lore raw
In reply to Taeung Song
perf python scripting: Append examples to err msg about audit-libs-python
Commit-ID:  b416e204f88dd91d9e99f6deee3d57fbc90aee40
Gitweb:     http://git.kernel.org/tip/b416e204f88dd91d9e99f6deee3d57fbc90aee40
Author:     Taeung Song <[email protected]>
AuthorDate: Tue, 9 Feb 2016 20:53:10 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Fri, 12 Feb 2016 11:30:27 -0300

perf python scripting: Append examples to err msg about audit-libs-python

To print syscall names, the audit-libs-python package is required.. If not installed, it prints this error string:

    # perf script syscall-counts
    Install the audit-libs-python package to get syscall names.

But the package name is different in Ubuntu, mention that in the error message, similar to a error message of util/trace-event-scripting.c:

    # perf script syscall-counts
    Install the audit-libs-python package to get syscall names.
    For example:
      # apt-get install python-audit (Ubuntu)
      # yum install audit-libs-python (Fedora)
      etc.
---
 tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py +4 -1
index 15c8400..1d95009 100644
@@ -71,7 +71,10 @@ try:
 except:
 	if not audit_package_warned:
 		audit_package_warned = True
-		print "Install the audit-libs-python package to get syscall names"
+		print "Install the audit-libs-python package to get syscall names.\n" \
+                    "For example:\n  # apt-get install python-audit (Ubuntu)" \
+                    "\n  # yum install audit-libs-python (Fedora)" \
+                    "\n  etc.\n"
 
 def syscall_name(id):
 	try: