Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 338989
b: refs/heads/master
c: bcd83ea
h: refs/heads/master
i:
  338987: e4e2fd1
v: v3
  • Loading branch information
Daniel Walter authored and Steven Rostedt committed Oct 31, 2012
1 parent a3354a5 commit 9e15cbf
Show file tree
Hide file tree
Showing 75 changed files with 519 additions and 2,133 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ccf59d8da119ab03dcbdf95fb5e5adcef6ba51f2
refs/heads/master: bcd83ea6cbfee54e33d1527b87538dc99ca2137b
2 changes: 1 addition & 1 deletion trunk/kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -4381,7 +4381,7 @@ ftrace_pid_write(struct file *filp, const char __user *ubuf,
if (strlen(tmp) == 0)
return 1;

ret = strict_strtol(tmp, 10, &val);
ret = kstrtol(tmp, 10, &val);
if (ret < 0)
return ret;

Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ static int __init set_tracing_thresh(char *str)

if (!str)
return 0;
ret = strict_strtoul(str, 0, &threshold);
ret = kstrtoul(str, 0, &threshold);
if (ret < 0)
return 0;
tracing_thresh = threshold * 1000;
Expand Down
4 changes: 2 additions & 2 deletions trunk/kernel/trace/trace_events_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1000,9 +1000,9 @@ static int init_pred(struct filter_parse_state *ps,
}
} else {
if (field->is_signed)
ret = strict_strtoll(pred->regex.pattern, 0, &val);
ret = kstrtoll(pred->regex.pattern, 0, &val);
else
ret = strict_strtoull(pred->regex.pattern, 0, &val);
ret = kstrtoull(pred->regex.pattern, 0, &val);
if (ret) {
parse_error(ps, FILT_ERR_ILLEGAL_INTVAL, 0);
return -EINVAL;
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/trace/trace_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ ftrace_trace_onoff_callback(struct ftrace_hash *hash,
* We use the callback data field (which is a pointer)
* as our counter.
*/
ret = strict_strtoul(number, 0, (unsigned long *)&count);
ret = kstrtoul(number, 0, (unsigned long *)&count);
if (ret)
return ret;

Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/trace/trace_kprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ static int create_trace_probe(int argc, char **argv)
return -EINVAL;
}
/* an address specified */
ret = strict_strtoul(&argv[1][0], 0, (unsigned long *)&addr);
ret = kstrtoul(&argv[1][0], 0, (unsigned long *)&addr);
if (ret) {
pr_info("Failed to parse address.\n");
return ret;
Expand Down
14 changes: 7 additions & 7 deletions trunk/kernel/trace/trace_probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ static const struct fetch_type *find_fetch_type(const char *type)
goto fail;

type++;
if (strict_strtoul(type, 0, &bs))
if (kstrtoul(type, 0, &bs))
goto fail;

switch (bs) {
Expand Down Expand Up @@ -501,8 +501,8 @@ int traceprobe_split_symbol_offset(char *symbol, unsigned long *offset)

tmp = strchr(symbol, '+');
if (tmp) {
/* skip sign because strict_strtol doesn't accept '+' */
ret = strict_strtoul(tmp + 1, 0, offset);
/* skip sign because kstrtoul doesn't accept '+' */
ret = kstrtoul(tmp + 1, 0, offset);
if (ret)
return ret;

Expand Down Expand Up @@ -533,7 +533,7 @@ static int parse_probe_vars(char *arg, const struct fetch_type *t,
else
ret = -EINVAL;
} else if (isdigit(arg[5])) {
ret = strict_strtoul(arg + 5, 10, &param);
ret = kstrtoul(arg + 5, 10, &param);
if (ret || param > PARAM_MAX_STACK)
ret = -EINVAL;
else {
Expand Down Expand Up @@ -579,7 +579,7 @@ static int parse_probe_arg(char *arg, const struct fetch_type *t,

case '@': /* memory or symbol */
if (isdigit(arg[1])) {
ret = strict_strtoul(arg + 1, 0, &param);
ret = kstrtoul(arg + 1, 0, &param);
if (ret)
break;

Expand All @@ -597,14 +597,14 @@ static int parse_probe_arg(char *arg, const struct fetch_type *t,
break;

case '+': /* deref memory */
arg++; /* Skip '+', because strict_strtol() rejects it. */
arg++; /* Skip '+', because kstrtol() rejects it. */
case '-':
tmp = strchr(arg, '(');
if (!tmp)
break;

*tmp = '\0';
ret = strict_strtol(arg, 0, &offset);
ret = kstrtol(arg, 0, &offset);

if (ret)
break;
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/trace/trace_uprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static int create_trace_uprobe(int argc, char **argv)
if (ret)
goto fail_address_parse;

ret = strict_strtoul(arg, 0, &offset);
ret = kstrtoul(arg, 0, &offset);
if (ret)
goto fail_address_parse;

Expand Down
22 changes: 10 additions & 12 deletions trunk/tools/lib/traceevent/event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ static int cmdline_init(struct pevent *pevent)
return 0;
}

static const char *find_cmdline(struct pevent *pevent, int pid)
static char *find_cmdline(struct pevent *pevent, int pid)
{
const struct cmdline *comm;
struct cmdline key;
Expand Down Expand Up @@ -2637,7 +2637,7 @@ process_func_handler(struct event_format *event, struct pevent_function_handler
struct print_arg *farg;
enum event_type type;
char *token;
const char *test;
char *test;
int i;

arg->type = PRINT_FUNC;
Expand Down Expand Up @@ -3889,7 +3889,7 @@ static void print_mac_arg(struct trace_seq *s, int mac, void *data, int size,
struct event_format *event, struct print_arg *arg)
{
unsigned char *buf;
const char *fmt = "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x";
char *fmt = "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x";

if (arg->type == PRINT_FUNC) {
process_defined_func(s, data, size, event, arg);
Expand Down Expand Up @@ -3931,8 +3931,7 @@ static int is_printable_array(char *p, unsigned int len)
return 1;
}

static void print_event_fields(struct trace_seq *s, void *data,
int size __maybe_unused,
static void print_event_fields(struct trace_seq *s, void *data, int size,
struct event_format *event)
{
struct format_field *field;
Expand Down Expand Up @@ -4409,7 +4408,7 @@ void pevent_event_info(struct trace_seq *s, struct event_format *event,
void pevent_print_event(struct pevent *pevent, struct trace_seq *s,
struct pevent_record *record)
{
static const char *spaces = " "; /* 20 spaces */
static char *spaces = " "; /* 20 spaces */
struct event_format *event;
unsigned long secs;
unsigned long usecs;
Expand Down Expand Up @@ -5071,8 +5070,8 @@ static const char * const pevent_error_str[] = {
};
#undef _PE

int pevent_strerror(struct pevent *pevent __maybe_unused,
enum pevent_errno errnum, char *buf, size_t buflen)
int pevent_strerror(struct pevent *pevent, enum pevent_errno errnum,
char *buf, size_t buflen)
{
int idx;
const char *msg;
Expand Down Expand Up @@ -5101,7 +5100,6 @@ int pevent_strerror(struct pevent *pevent __maybe_unused,
case PEVENT_ERRNO__READ_FORMAT_FAILED:
case PEVENT_ERRNO__READ_PRINT_FAILED:
case PEVENT_ERRNO__OLD_FTRACE_ARG_FAILED:
case PEVENT_ERRNO__INVALID_ARG_TYPE:
snprintf(buf, buflen, "%s", msg);
break;

Expand Down Expand Up @@ -5364,7 +5362,7 @@ int pevent_register_print_function(struct pevent *pevent,
if (type == PEVENT_FUNC_ARG_VOID)
break;

if (type >= PEVENT_FUNC_ARG_MAX_TYPES) {
if (type < 0 || type >= PEVENT_FUNC_ARG_MAX_TYPES) {
do_warning("Invalid argument type %d", type);
ret = PEVENT_ERRNO__INVALID_ARG_TYPE;
goto out_free;
Expand Down Expand Up @@ -5562,7 +5560,7 @@ void pevent_free(struct pevent *pevent)
}

if (pevent->func_map) {
for (i = 0; i < (int)pevent->func_count; i++) {
for (i = 0; i < pevent->func_count; i++) {
free(pevent->func_map[i].func);
free(pevent->func_map[i].mod);
}
Expand All @@ -5584,7 +5582,7 @@ void pevent_free(struct pevent *pevent)
}

if (pevent->printk_map) {
for (i = 0; i < (int)pevent->printk_count; i++)
for (i = 0; i < pevent->printk_count; i++)
free(pevent->printk_map[i].printk);
free(pevent->printk_map);
}
Expand Down
5 changes: 1 addition & 4 deletions trunk/tools/perf/Documentation/android.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ For x86:
II. Compile perf for Android
------------------------------------------------
You need to run make with the NDK toolchain and sysroot defined above:
For arm:
make ARCH=arm CROSS_COMPILE=${NDK_TOOLCHAIN} CFLAGS="--sysroot=${NDK_SYSROOT}"
For x86:
make ARCH=x86 CROSS_COMPILE=${NDK_TOOLCHAIN} CFLAGS="--sysroot=${NDK_SYSROOT}"
make CROSS_COMPILE=${NDK_TOOLCHAIN} CFLAGS="--sysroot=${NDK_SYSROOT}"

III. Install perf
-----------------------------------------------
Expand Down
34 changes: 7 additions & 27 deletions trunk/tools/perf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ endif

### --- END CONFIGURATION SECTION ---

BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -I$(OUTPUT)util -Iutil -I. -I$(TRACE_EVENT_DIR) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -I$(OUTPUT)util -I$(TRACE_EVENT_DIR) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
BASIC_LDFLAGS =

ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y)
Expand Down Expand Up @@ -371,6 +371,7 @@ LIB_OBJS += $(OUTPUT)util/help.o
LIB_OBJS += $(OUTPUT)util/levenshtein.o
LIB_OBJS += $(OUTPUT)util/parse-options.o
LIB_OBJS += $(OUTPUT)util/parse-events.o
LIB_OBJS += $(OUTPUT)util/parse-events-test.o
LIB_OBJS += $(OUTPUT)util/path.o
LIB_OBJS += $(OUTPUT)util/rbtree.o
LIB_OBJS += $(OUTPUT)util/bitmap.o
Expand All @@ -388,6 +389,7 @@ LIB_OBJS += $(OUTPUT)util/sigchain.o
LIB_OBJS += $(OUTPUT)util/dso.o
LIB_OBJS += $(OUTPUT)util/symbol.o
LIB_OBJS += $(OUTPUT)util/symbol-elf.o
LIB_OBJS += $(OUTPUT)util/dso-test-data.o
LIB_OBJS += $(OUTPUT)util/color.o
LIB_OBJS += $(OUTPUT)util/pager.o
LIB_OBJS += $(OUTPUT)util/header.o
Expand Down Expand Up @@ -428,10 +430,6 @@ LIB_OBJS += $(OUTPUT)ui/stdio/hist.o

LIB_OBJS += $(OUTPUT)arch/common.o

LIB_OBJS += $(OUTPUT)tests/parse-events.o
LIB_OBJS += $(OUTPUT)tests/dso-data.o
LIB_OBJS += $(OUTPUT)tests/attr.o

BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
# Benchmark modules
Expand Down Expand Up @@ -461,8 +459,8 @@ BUILTIN_OBJS += $(OUTPUT)builtin-probe.o
BUILTIN_OBJS += $(OUTPUT)builtin-kmem.o
BUILTIN_OBJS += $(OUTPUT)builtin-lock.o
BUILTIN_OBJS += $(OUTPUT)builtin-kvm.o
BUILTIN_OBJS += $(OUTPUT)builtin-test.o
BUILTIN_OBJS += $(OUTPUT)builtin-inject.o
BUILTIN_OBJS += $(OUTPUT)tests/builtin-test.o

PERFLIBS = $(LIB_FILE) $(LIBTRACEEVENT)

Expand Down Expand Up @@ -492,23 +490,14 @@ ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y)
LIBC_SUPPORT := 1
endif
ifeq ($(LIBC_SUPPORT),1)
msg := $(warning No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev);

NO_LIBELF := 1
NO_DWARF := 1
NO_DEMANGLE := 1
else
msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
endif
else
# for linking with debug library, run like:
# make DEBUG=1 LIBDW_DIR=/opt/libdw/
ifdef LIBDW_DIR
LIBDW_CFLAGS := -I$(LIBDW_DIR)/include
LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
endif

FLAGS_DWARF=$(ALL_CFLAGS) $(LIBDW_CFLAGS) -ldw -lelf $(LIBDW_LDFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS)
ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y)
msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
NO_DWARF := 1
Expand Down Expand Up @@ -563,8 +552,7 @@ ifndef NO_DWARF
ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);
else
BASIC_CFLAGS := -DDWARF_SUPPORT $(LIBDW_CFLAGS) $(BASIC_CFLAGS)
BASIC_LDFLAGS := $(LIBDW_LDFLAGS) $(BASIC_LDFLAGS)
BASIC_CFLAGS += -DDWARF_SUPPORT
EXTLIBS += -lelf -ldw
LIB_OBJS += $(OUTPUT)util/probe-finder.o
LIB_OBJS += $(OUTPUT)util/dwarf-aux.o
Expand Down Expand Up @@ -903,14 +891,10 @@ $(OUTPUT)%.s: %.S
$(OUTPUT)util/exec_cmd.o: util/exec_cmd.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
'-DPERF_EXEC_PATH="$(perfexecdir_SQ)"' \
'-DBINDIR="$(bindir_relative_SQ)"' \
'-DPREFIX="$(prefix_SQ)"' \
$<

$(OUTPUT)tests/attr.o: tests/attr.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
'-DBINDIR="$(bindir_SQ)"' \
$<

$(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<

Expand Down Expand Up @@ -1075,10 +1059,6 @@ install: all try-install-man
$(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d'
$(INSTALL) bash_completion '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf'
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
$(INSTALL) tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
$(INSTALL) tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'

install-python_ext:
$(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)'
Expand Down
Loading

0 comments on commit 9e15cbf

Please sign in to comment.