lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-uxeunqetd0sgxyibusapen9a@git.kernel.org>
Date:	Thu, 5 Jun 2014 07:30:44 -0700
From:	tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, eranian@...gle.com, paulus@...ba.org,
	acme@...hat.com, hpa@...or.com, mingo@...nel.org, jolsa@...nel.org,
	peterz@...radead.org, efault@....de, namhyung@...nel.org,
	fweisbec@...il.com, adrian.hunter@...el.com, dsahern@...il.com,
	tglx@...utronix.de, dzickus@...hat.com
Subject: [tip:perf/core] perf trace: Warn the user when not available

Commit-ID:  1b5726220fe16ac38eb2db43e7bc82e69f449fca
Gitweb:     http://git.kernel.org/tip/1b5726220fe16ac38eb2db43e7bc82e69f449fca
Author:     Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Mon, 26 May 2014 16:02:29 -0300
Committer:  Jiri Olsa <jolsa@...nel.org>
CommitDate: Tue, 3 Jun 2014 21:34:00 +0200

perf trace: Warn the user when not available

When the audit-libs devel package is not found at build time we disable
the 'trace' command, as we are not able to map syscall numbers to
strings, but then the message the user is presented is cryptic:

  [root@zoo linux]# trace ls
  perf: 'ls' is not a perf-command. See 'perf --help'.

Fix it by presenting a more helpful message:

  [root@zoo linux]# trace l
  trace command not available: missing audit-libs devel package at build time.

Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Don Zickus <dzickus@...hat.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Mike Galbraith <efault@....de>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stephane Eranian <eranian@...gle.com>
Link: http://lkml.kernel.org/n/tip-uxeunqetd0sgxyibusapen9a@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
---
 tools/perf/perf.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 431798a..78f7b92 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -481,14 +481,18 @@ int main(int argc, const char **argv)
 		fprintf(stderr, "cannot handle %s internally", cmd);
 		goto out;
 	}
-#ifdef HAVE_LIBAUDIT_SUPPORT
 	if (!prefixcmp(cmd, "trace")) {
+#ifdef HAVE_LIBAUDIT_SUPPORT
 		set_buildid_dir();
 		setup_path();
 		argv[0] = "trace";
 		return cmd_trace(argc, argv, NULL);
-	}
+#else
+		fprintf(stderr,
+			"trace command not available: missing audit-libs devel package at build time.\n");
+		goto out;
 #endif
+	}
 	/* Look for flags.. */
 	argv++;
 	argc--;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ