Skip to content

Commit

Permalink
uftrace: Remove -L option for later usage
Browse files Browse the repository at this point in the history
The -L/--library-path option is primarily used for testing purposes.
But the -L option has been removed to make it more useful for other purposes.
The --library-path is also replaced with more meaningful --libmcount-path.

Signed-off-by: Eunseon Lee <[email protected]>
  • Loading branch information
ekyooo authored and namhyung committed Mar 28, 2022
1 parent 583a1df commit eed5717
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions doc/ko/uftrace-live.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ RECORD 옵션

RECORD 설정 옵션
=====================
-L *PATH*, \--library-path=*PATH*
: 필요한 내부 라이브러리를 *PATH* 에서 먼저 찾는다.
\--libmcount-path=*PATH*
: limcount 라이브러리를 *PATH* 에서 먼저 찾는다.
이 옵션은 대부분 테스트 목적으로 사용된다.

-b *SIZE*, \--buffer=*SIZE*
Expand Down
4 changes: 2 additions & 2 deletions doc/ko/uftrace-record.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ RECORD 옵션

RECORD 설정 옵션
=====================
-L *PATH*, \--library-path=*PATH*
: 필요한 내부 라이브러리를 *PATH* 에서 먼저 찾는다.
\--libmcount-path=*PATH*
: libmcount 라이브러리를 *PATH* 에서 먼저 찾는다.
이 옵션은 대부분 테스트 목적으로 사용된다.

-b *SIZE*, \--buffer=*SIZE*
Expand Down
5 changes: 2 additions & 3 deletions doc/uftrace-live.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,8 @@ RECORD OPTIONS

RECORD CONFIG OPTIONS
=====================
-L *PATH*, \--library-path=*PATH*
: Load necessary internal libraries from this path. This is mostly for
testing purposes.
\--libmcount-path=*PATH*
: Load libmcount libraries from this path. This is mostly for testing purposes.

-b *SIZE*, \--buffer=*SIZE*
: Size of internal buffer in which trace data will be saved. Default size is
Expand Down
5 changes: 2 additions & 3 deletions doc/uftrace-record.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,8 @@ COMMON OPTIONS

RECORD CONFIG OPTIONS
=====================
-L *PATH*, \--library-path=*PATH*
: Load necessary internal libraries from this path. This is mostly for
testing purposes.
\--libmcount-path=*PATH*
: Load libmcount libraries from this path. This is mostly for testing purposes.

-b *SIZE*, \--buffer=*SIZE*
: Size of internal buffer in which trace data will be saved. Default size is
Expand Down
2 changes: 1 addition & 1 deletion misc/bash-completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ _uftrace () {
uftrace_comp="${subcmds} ${options}"

case $prev in
-d|--data|--diff|-L|--library-path)
-d|--data|--diff|-L|--libmcount-path)
# complete directory name
COMPREPLY=($(compgen -d -- "${cur}"))
;;
Expand Down
2 changes: 1 addition & 1 deletion tests/arch/arm/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CC = gcc
RM = rm -f
UFTRACE = ../../../uftrace -L ../../.. --flat
UFTRACE = ../../../uftrace --libmcount-path=../../.. --flat

#CFLAGS = -g -finstrument-functions
CFLAGS = -g -pg -fno-omit-frame-pointer
Expand Down
2 changes: 1 addition & 1 deletion tests/arch/x86_64/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CC = gcc
RM = rm -f
UFTRACE = ../../../uftrace -L ../../.. --flat
UFTRACE = ../../../uftrace --libmcount-path=../../.. --flat

CFLAGS = -g -finstrument-functions

Expand Down
2 changes: 1 addition & 1 deletion tests/runtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class TestBase:
basedir = os.path.dirname(os.getcwd())
objdir = 'objdir' in os.environ and os.environ['objdir'] or basedir
uftrace_cmd = objdir + '/uftrace'
default_opt = '--no-pager --no-event -L' + objdir
default_opt = '--no-pager --no-event --libmcount-path=' + objdir

default_cflags = ['-fno-inline', '-fno-builtin', '-fno-ipa-cp',
'-fno-omit-frame-pointer', '-D_FORTIFY_SOURCE=0']
Expand Down
2 changes: 1 addition & 1 deletion tests/t183_info_quote.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def __init__(self):
# ==================
# program version : uftrace v0.8.1-133-g7f71
# recorded on : Mon Nov 27 09:40:31 2017
# cmdline : ../uftrace record --no-pager --no-event -L.. t-hello \\"uftrace\\"
# cmdline : ../uftrace record --no-pager --no-event --libmcount-path=.. t-hello \\"uftrace\\"
# cpu info : Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz
# number of cpus : 12 / 12 (online / possible)
# memory info : 13.2 / 23.5 GB (free / total)
Expand Down
2 changes: 1 addition & 1 deletion tests/t196_chrome_taskname.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self):
{"ts":13453314722.631,"ph":"E","pid":4694,"name":"task_name2"},
{"ts":13453314722.695,"ph":"E","pid":4694,"name":"main"}
], "displayTimeUnit": "ns", "metadata": {
"command_line":"../uftrace record --no-pager --no-event -L.. t-taskname",
"command_line":"../uftrace record --no-pager --no-event --libmcount-path=.. t-taskname",
"recorded_time":"Tue Jan 30 16:05:24 2018"
} }
""", sort='chrome')
Expand Down
16 changes: 9 additions & 7 deletions uftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ enum options {
OPT_with_syms,
OPT_clock,
OPT_usage,
OPT_libmcount_path,
};

__used static const char uftrace_usage[] =
Expand Down Expand Up @@ -175,7 +176,7 @@ __used static const char uftrace_help[] =
" --logfile=FILE Save log messages to this file\n"
" -l, --nest-libcall Show nested library calls\n"
" --libname Show libname name with symbol name\n"
" -L, --library-path=PATH Load libraries from this PATH\n"
" --libmcount-path=PATH Load libmcount libraries from this PATH\n"
" --match=TYPE Support pattern match: regex, glob (default:\n"
" regex)\n"
" --max-stack=DEPTH Set max stack depth to DEPTH (default: "
Expand Down Expand Up @@ -237,13 +238,14 @@ __used static const char uftrace_footer[] =
"\n";

static const char uftrace_shopts[] =
"+aA:b:C:d:D:eE:f:F:hH:kK:lL:N:P:r:R:s:S:t:T:U:vVW:Z:";
"+aA:b:C:d:D:eE:f:F:hH:kK:lN:P:r:R:s:S:t:T:U:vVW:Z:";

#define REQ_ARG(name, shopt) { #name, required_argument, 0, shopt }
#define NO_ARG(name, shopt) { #name, no_argument, 0, shopt }

static const struct option uftrace_options[] = {
REQ_ARG(library-path, 'L'),
REQ_ARG(libmcount-path, OPT_libmcount_path),
REQ_ARG(library-path, OPT_libmcount_path),
REQ_ARG(filter, 'F'),
REQ_ARG(notrace, 'L'),
REQ_ARG(depth, 'D'),
Expand Down Expand Up @@ -543,10 +545,6 @@ static char * remove_trailing_slash(char *path)
static int parse_option(struct opts *opts, int key, char *arg)
{
switch (key) {
case 'L':
opts->lib_path = arg;
break;

case 'F':
opts->filter = opt_add_string(opts->filter, arg);
break;
Expand Down Expand Up @@ -704,6 +702,10 @@ static int parse_option(struct opts *opts, int key, char *arg)
case 'h':
return -3;

case OPT_libmcount_path:
opts->lib_path = arg;
break;

case OPT_usage:
return -2;

Expand Down

0 comments on commit eed5717

Please sign in to comment.