Skip to content

Commit

Permalink
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/kernel/git/tip/linux-2.6-tip

* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  perf events: Update MAINTAINERS entry file patterns
  perf tools: Remove static debugfs path from parse-events
  perf tools: Fix the NO_64BIT build on pure 64-bit systems
  perf tools: Fix const char type propagation
  • Loading branch information
Linus Torvalds committed Oct 14, 2009
2 parents f061d83 + a003236 commit 220a625
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 14 deletions.
7 changes: 7 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -4076,6 +4076,13 @@ M: Peter Zijlstra <a.p.zijlstra@chello.nl>
M: Paul Mackerras <paulus@samba.org>
M: Ingo Molnar <mingo@elte.hu>
S: Supported
F: kernel/perf_event.c
F: include/linux/perf_event.h
F: arch/*/*/kernel/perf_event.c
F: arch/*/include/asm/perf_event.h
F: arch/*/lib/perf_event.c
F: arch/*/kernel/perf_callchain.c
F: tools/perf/

PERSONALITY HANDLING
M: Christoph Hellwig <hch@infradead.org>
Expand Down
21 changes: 14 additions & 7 deletions tools/perf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,18 @@ uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')

# If we're on a 64-bit kernel, use -m64
ifndef NO_64BIT
ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M))
M64 := -m64
endif
#
# Add -m32 for cross-builds:
#
ifdef NO_64BIT
MBITS := -m32
else
#
# If we're on a 64-bit kernel, use -m64:
#
ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M))
MBITS := -m64
endif
endif

# CFLAGS and LDFLAGS are for the users to override from the command line.
Expand Down Expand Up @@ -194,7 +201,7 @@ EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wold-style-definition
EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes
EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement

CFLAGS = $(M64) -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
LDFLAGS = -lpthread -lrt -lelf -lm
ALL_CFLAGS = $(CFLAGS)
ALL_LDFLAGS = $(LDFLAGS)
Expand Down Expand Up @@ -416,7 +423,7 @@ ifeq ($(uname_S),Darwin)
endif

ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel);
msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]);
endif

ifdef NO_DEMANGLE
Expand Down
4 changes: 2 additions & 2 deletions tools/perf/builtin-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ static struct sort_dimension *available_sorts[] = {

static LIST_HEAD(sort_list);

static int sort_dimension__add(char *tok, struct list_head *list)
static int sort_dimension__add(const char *tok, struct list_head *list)
{
int i;

Expand Down Expand Up @@ -1917,7 +1917,7 @@ static void setup_sorting(void)

free(str);

sort_dimension__add((char *)"pid", &cmp_pid);
sort_dimension__add("pid", &cmp_pid);
}

static const char *record_args[] = {
Expand Down
5 changes: 4 additions & 1 deletion tools/perf/util/parse-events.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,10 @@ static void store_event_type(const char *orgname)
FILE *file;
int id;

sprintf(filename, "/sys/kernel/debug/tracing/events/%s/id", orgname);
sprintf(filename, "%s/", debugfs_path);
strncat(filename, orgname, strlen(orgname));
strcat(filename, "/id");

c = strchr(filename, ':');
if (c)
*c = '/';
Expand Down
8 changes: 4 additions & 4 deletions tools/perf/util/trace-event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ static int test_type(enum event_type type, enum event_type expect)
}

static int test_type_token(enum event_type type, char *token,
enum event_type expect, char *expect_tok)
enum event_type expect, const char *expect_tok)
{
if (type != expect) {
die("Error: expected type %d but read %d",
Expand Down Expand Up @@ -650,7 +650,7 @@ static int read_expect_type(enum event_type expect, char **tok)
return __read_expect_type(expect, tok, 1);
}

static int __read_expected(enum event_type expect, char *str, int newline_ok)
static int __read_expected(enum event_type expect, const char *str, int newline_ok)
{
enum event_type type;
char *token;
Expand All @@ -668,12 +668,12 @@ static int __read_expected(enum event_type expect, char *str, int newline_ok)
return 0;
}

static int read_expected(enum event_type expect, char *str)
static int read_expected(enum event_type expect, const char *str)
{
return __read_expected(expect, str, 1);
}

static int read_expected_item(enum event_type expect, char *str)
static int read_expected_item(enum event_type expect, const char *str)
{
return __read_expected(expect, str, 0);
}
Expand Down

0 comments on commit 220a625

Please sign in to comment.