Skip to content

Commit

Permalink
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/kernel/git/acme/linux into perf/core

Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

 * Remove die()/exit() calls from several tools.

 * Add missing perf_regs.h file to MANIFEST

 * Clean up and improve 'perf sched' performance by elliminating lots of
   needless calls to libtraceevent.

 * More patches to make perf build on Android, from Irina Tirdea

 * Resolve vdso callchains, from Jiri Olsa

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Ingo Molnar committed Sep 13, 2012
2 parents d5cb2ae + 9ec3f4e commit be267be
Show file tree
Hide file tree
Showing 92 changed files with 1,518 additions and 1,231 deletions.
8 changes: 5 additions & 3 deletions tools/lib/traceevent/event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1824,7 +1824,7 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok)
}

static enum event_type
process_entry(struct event_format *event __unused, struct print_arg *arg,
process_entry(struct event_format *event __maybe_unused, struct print_arg *arg,
char **tok)
{
enum event_type type;
Expand Down Expand Up @@ -2458,7 +2458,8 @@ process_paren(struct event_format *event, struct print_arg *arg, char **tok)


static enum event_type
process_str(struct event_format *event __unused, struct print_arg *arg, char **tok)
process_str(struct event_format *event __maybe_unused, struct print_arg *arg,
char **tok)
{
enum event_type type;
char *token;
Expand Down Expand Up @@ -3653,7 +3654,8 @@ static void free_args(struct print_arg *args)
}

static char *
get_bprint_format(void *data, int size __unused, struct event_format *event)
get_bprint_format(void *data, int size __maybe_unused,
struct event_format *event)
{
struct pevent *pevent = event->pevent;
unsigned long long addr;
Expand Down
4 changes: 2 additions & 2 deletions tools/lib/traceevent/event-parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#include <stdarg.h>
#include <regex.h>

#ifndef __unused
#define __unused __attribute__ ((unused))
#ifndef __maybe_unused
#define __maybe_unused __attribute__((unused))
#endif

/* ----------------------- trace_seq ----------------------- */
Expand Down
1 change: 1 addition & 0 deletions tools/perf/MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ include/linux/stringify.h
lib/rbtree.c
include/linux/swab.h
arch/*/include/asm/unistd*.h
arch/*/include/asm/perf_regs.h
arch/*/lib/memcpy*.S
arch/*/lib/memset*.S
include/linux/poison.h
Expand Down
3 changes: 3 additions & 0 deletions tools/perf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ LIB_H += util/include/linux/ctype.h
LIB_H += util/include/linux/kernel.h
LIB_H += util/include/linux/list.h
LIB_H += util/include/linux/export.h
LIB_H += util/include/linux/magic.h
LIB_H += util/include/linux/poison.h
LIB_H += util/include/linux/prefetch.h
LIB_H += util/include/linux/rbtree.h
Expand Down Expand Up @@ -336,6 +337,7 @@ LIB_H += util/intlist.h
LIB_H += util/perf_regs.h
LIB_H += util/unwind.h
LIB_H += ui/helpline.h
LIB_H += util/vdso.h

LIB_OBJS += $(OUTPUT)util/abspath.o
LIB_OBJS += $(OUTPUT)util/alias.o
Expand Down Expand Up @@ -403,6 +405,7 @@ LIB_OBJS += $(OUTPUT)util/cgroup.o
LIB_OBJS += $(OUTPUT)util/target.o
LIB_OBJS += $(OUTPUT)util/rblist.o
LIB_OBJS += $(OUTPUT)util/intlist.o
LIB_OBJS += $(OUTPUT)util/vdso.o

LIB_OBJS += $(OUTPUT)ui/helpline.o
LIB_OBJS += $(OUTPUT)ui/hist.o
Expand Down
3 changes: 2 additions & 1 deletion tools/perf/bench/bench.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

extern int bench_sched_messaging(int argc, const char **argv, const char *prefix);
extern int bench_sched_pipe(int argc, const char **argv, const char *prefix);
extern int bench_mem_memcpy(int argc, const char **argv, const char *prefix __used);
extern int bench_mem_memcpy(int argc, const char **argv,
const char *prefix __maybe_unused);
extern int bench_mem_memset(int argc, const char **argv, const char *prefix);

#define BENCH_FORMAT_DEFAULT_STR "default"
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/bench/mem-memcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static double do_memcpy_gettimeofday(memcpy_t fn, size_t len, bool prefault)
} while (0)

int bench_mem_memcpy(int argc, const char **argv,
const char *prefix __used)
const char *prefix __maybe_unused)
{
int i;
size_t len;
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/bench/mem-memset.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ static double do_memset_gettimeofday(memset_t fn, size_t len, bool prefault)
} while (0)

int bench_mem_memset(int argc, const char **argv,
const char *prefix __used)
const char *prefix __maybe_unused)
{
int i;
size_t len;
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/bench/sched-messaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ static const char * const bench_sched_message_usage[] = {
};

int bench_sched_messaging(int argc, const char **argv,
const char *prefix __used)
const char *prefix __maybe_unused)
{
unsigned int i, total_children;
struct timeval start, stop, diff;
Expand Down
6 changes: 3 additions & 3 deletions tools/perf/bench/sched-pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static const char * const bench_sched_pipe_usage[] = {
};

int bench_sched_pipe(int argc, const char **argv,
const char *prefix __used)
const char *prefix __maybe_unused)
{
int pipe_1[2], pipe_2[2];
int m = 0, i;
Expand All @@ -55,8 +55,8 @@ int bench_sched_pipe(int argc, const char **argv,
* discarding returned value of read(), write()
* causes error in building environment for perf
*/
int __used ret, wait_stat;
pid_t pid, retpid __used;
int __maybe_unused ret, wait_stat;
pid_t pid, retpid __maybe_unused;

argc = parse_options(argc, argv, options,
bench_sched_pipe_usage, 0);
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/builtin-annotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ static const char * const annotate_usage[] = {
NULL
};

int cmd_annotate(int argc, const char **argv, const char *prefix __used)
int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
{
struct perf_annotate annotate = {
.tool = {
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/builtin-bench.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static void all_subsystem(void)
all_suite(&subsystems[i]);
}

int cmd_bench(int argc, const char **argv, const char *prefix __used)
int cmd_bench(int argc, const char **argv, const char *prefix __maybe_unused)
{
int i, j, status = 0;

Expand Down
10 changes: 6 additions & 4 deletions tools/perf/builtin-buildid-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,16 @@ static int build_id_cache__add_file(const char *filename, const char *debugdir)
}

build_id__sprintf(build_id, sizeof(build_id), sbuild_id);
err = build_id_cache__add_s(sbuild_id, debugdir, filename, false);
err = build_id_cache__add_s(sbuild_id, debugdir, filename,
false, false);
if (verbose)
pr_info("Adding %s %s: %s\n", sbuild_id, filename,
err ? "FAIL" : "Ok");
return err;
}

static int build_id_cache__remove_file(const char *filename __used,
const char *debugdir __used)
static int build_id_cache__remove_file(const char *filename __maybe_unused,
const char *debugdir __maybe_unused)
{
u8 build_id[BUILD_ID_SIZE];
char sbuild_id[BUILD_ID_SIZE * 2 + 1];
Expand Down Expand Up @@ -119,7 +120,8 @@ static int __cmd_buildid_cache(void)
return 0;
}

int cmd_buildid_cache(int argc, const char **argv, const char *prefix __used)
int cmd_buildid_cache(int argc, const char **argv,
const char *prefix __maybe_unused)
{
argc = parse_options(argc, argv, buildid_cache_options,
buildid_cache_usage, 0);
Expand Down
3 changes: 2 additions & 1 deletion tools/perf/builtin-buildid-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ static int __cmd_buildid_list(void)
return perf_session__list_build_ids();
}

int cmd_buildid_list(int argc, const char **argv, const char *prefix __used)
int cmd_buildid_list(int argc, const char **argv,
const char *prefix __maybe_unused)
{
argc = parse_options(argc, argv, options, buildid_list_usage, 0);
setup_pager();
Expand Down
4 changes: 2 additions & 2 deletions tools/perf/builtin-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static int hists__add_entry(struct hists *self,
return -ENOMEM;
}

static int diff__process_sample_event(struct perf_tool *tool __used,
static int diff__process_sample_event(struct perf_tool *tool __maybe_unused,
union perf_event *event,
struct perf_sample *sample,
struct perf_evsel *evsel,
Expand Down Expand Up @@ -242,7 +242,7 @@ static const struct option options[] = {
OPT_END()
};

int cmd_diff(int argc, const char **argv, const char *prefix __used)
int cmd_diff(int argc, const char **argv, const char *prefix __maybe_unused)
{
sort_order = diff__default_sort_order;
argc = parse_options(argc, argv, options, diff_usage, 0);
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/builtin-evlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static const char * const evlist_usage[] = {
NULL
};

int cmd_evlist(int argc, const char **argv, const char *prefix __used)
int cmd_evlist(int argc, const char **argv, const char *prefix __maybe_unused)
{
struct perf_attr_details details = { .verbose = false, };
const char *input_name = NULL;
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/builtin-help.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ static int show_html_page(const char *perf_cmd)
return 0;
}

int cmd_help(int argc, const char **argv, const char *prefix __used)
int cmd_help(int argc, const char **argv, const char *prefix __maybe_unused)
{
const char *alias;
int rc = 0;
Expand Down
24 changes: 13 additions & 11 deletions tools/perf/builtin-inject.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
static char const *input_name = "-";
static bool inject_build_ids;

static int perf_event__repipe_synth(struct perf_tool *tool __used,
static int perf_event__repipe_synth(struct perf_tool *tool __maybe_unused,
union perf_event *event,
struct machine *machine __used)
struct machine *machine __maybe_unused)
{
uint32_t size;
void *buf = event;
Expand All @@ -40,7 +40,8 @@ static int perf_event__repipe_synth(struct perf_tool *tool __used,

static int perf_event__repipe_op2_synth(struct perf_tool *tool,
union perf_event *event,
struct perf_session *session __used)
struct perf_session *session
__maybe_unused)
{
return perf_event__repipe_synth(tool, event, NULL);
}
Expand All @@ -52,13 +53,14 @@ static int perf_event__repipe_event_type_synth(struct perf_tool *tool,
}

static int perf_event__repipe_tracing_data_synth(union perf_event *event,
struct perf_session *session __used)
struct perf_session *session
__maybe_unused)
{
return perf_event__repipe_synth(NULL, event, NULL);
}

static int perf_event__repipe_attr(union perf_event *event,
struct perf_evlist **pevlist __used)
struct perf_evlist **pevlist __maybe_unused)
{
int ret;
ret = perf_event__process_attr(event, pevlist);
Expand All @@ -70,16 +72,16 @@ static int perf_event__repipe_attr(union perf_event *event,

static int perf_event__repipe(struct perf_tool *tool,
union perf_event *event,
struct perf_sample *sample __used,
struct perf_sample *sample __maybe_unused,
struct machine *machine)
{
return perf_event__repipe_synth(tool, event, machine);
}

static int perf_event__repipe_sample(struct perf_tool *tool,
union perf_event *event,
struct perf_sample *sample __used,
struct perf_evsel *evsel __used,
struct perf_sample *sample __maybe_unused,
struct perf_evsel *evsel __maybe_unused,
struct machine *machine)
{
return perf_event__repipe_synth(tool, event, machine);
Expand Down Expand Up @@ -163,7 +165,7 @@ static int dso__inject_build_id(struct dso *self, struct perf_tool *tool,
static int perf_event__inject_buildid(struct perf_tool *tool,
union perf_event *event,
struct perf_sample *sample,
struct perf_evsel *evsel __used,
struct perf_evsel *evsel __maybe_unused,
struct machine *machine)
{
struct addr_location al;
Expand Down Expand Up @@ -224,7 +226,7 @@ struct perf_tool perf_inject = {

extern volatile int session_done;

static void sig_handler(int sig __attribute__((__unused__)))
static void sig_handler(int sig __maybe_unused)
{
session_done = 1;
}
Expand Down Expand Up @@ -267,7 +269,7 @@ static const struct option options[] = {
OPT_END()
};

int cmd_inject(int argc, const char **argv, const char *prefix __used)
int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused)
{
argc = parse_options(argc, argv, options, report_usage, 0);

Expand Down
Loading

0 comments on commit be267be

Please sign in to comment.