From ab67022bd5b60c839cc5d8360cd0c0a7f8c21f83 Mon Sep 17 00:00:00 2001 From: Jiri Olsa Date: Sun, 17 Oct 2010 21:28:06 +0200 Subject: enhancing names check with *-logic for "-l -t -f -s -n -b" options Artur Skawina --- ChangeLog | 5 +++++ configure.ac | 2 +- doc/latrace.txt | 12 ++++++++++++ src/audit.c | 3 ++- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7529a94..27022f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-10-17 Jiri Olsa + * Artur Skawina + - enhancing names check with *-logic for + "-l -t -f -s -n -b" options + ------------------------------------------------------------------------------- latrace 0.5.10 diff --git a/configure.ac b/configure.ac index f535909..bf5e984 100644 --- a/configure.ac +++ b/configure.ac @@ -18,7 +18,7 @@ AC_PREREQ(2.61) -AC_INIT(latrace, 0.5.10, olsajiri@gmail.com) +AC_INIT(latrace, 0.5.11, olsajiri@gmail.com) AC_CONFIG_SRCDIR([src/latrace.c]) AC_PROG_CC diff --git a/doc/latrace.txt b/doc/latrace.txt index e433617..7a8f2fa 100644 --- a/doc/latrace.txt +++ b/doc/latrace.txt @@ -171,6 +171,18 @@ EXAMPLES [[DISCUSSION]] DISCUSSION ---------- +NAMES CHECK +~~~~~~~~~~~ +For options *"-l -t -f -s -n -b"* the *** symbol can be used to switch to the +substring search. If it is not specified, the exact search for the name is done. + +Examples: + + -s "*krava" checks for symbols with "krava" substring. + + -s "krava" checks only for "krava" symbol + + LD_AUDIT ~~~~~~~~ This is just a brief and vague description of the *LD_AUDIT* feature. diff --git a/src/audit.c b/src/audit.c index 03e0c48..2313c7c 100644 --- a/src/audit.c +++ b/src/audit.c @@ -47,7 +47,8 @@ static int check_names(char *name, char **ptr) char *n; for(n = *ptr; n; n = *(++ptr)) { - if (strstr(name, n)) { + if ((n[0] == '*' && strstr(name, n + 1)) || + strcmp(name, n) == 0) { PRINT_VERBOSE(&cfg, 2, "return %d for name %s\n", 1, name); return 1; -- cgit