Commit 4f0ac854 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'perfcounters-core-for-linus' of...

Merge branch 'perfcounters-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'perfcounters-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (60 commits)
  perf tools: Avoid unnecessary work in directory lookups
  perf stat: Clean up statistics calculations a bit more
  perf stat: More advanced variance computation
  perf stat: Use stddev_mean in stead of stddev
  perf stat: Remove the limit on repeat
  perf stat: Change noise calculation to use stddev
  x86, perf_counter, bts: Do not allow kernel BTS tracing for now
  x86, perf_counter, bts: Correct pointer-to-u64 casts
  x86, perf_counter, bts: Fail if BTS is not available
  perf_counter: Fix output-sharing error path
  perf trace: Fix read_string()
  perf trace: Print out in nanoseconds
  perf tools: Seek to the end of the header area
  perf trace: Fix parsing of perf.data
  perf trace: Sample timestamps as well
  perf_counter: Introduce new (non-)paranoia level to allow raw tracepoint access
  perf trace: Sample the CPU too
  perf tools: Work around strict aliasing related warnings
  perf tools: Clean up warnings list in the Makefile
  perf tools: Complete support for dynamic strings
  ...
parents b9356c53 6b58e7f1
...@@ -53,6 +53,12 @@ static int get_value(struct parse_opt_ctx_t *p, ...@@ -53,6 +53,12 @@ static int get_value(struct parse_opt_ctx_t *p,
case OPTION_SET_INT: case OPTION_SET_INT:
case OPTION_SET_PTR: case OPTION_SET_PTR:
return opterror(opt, "takes no value", flags); return opterror(opt, "takes no value", flags);
case OPTION_END:
case OPTION_ARGUMENT:
case OPTION_GROUP:
case OPTION_STRING:
case OPTION_INTEGER:
case OPTION_LONG:
default: default:
break; break;
} }
...@@ -130,6 +136,9 @@ static int get_value(struct parse_opt_ctx_t *p, ...@@ -130,6 +136,9 @@ static int get_value(struct parse_opt_ctx_t *p,
return opterror(opt, "expects a numerical value", flags); return opterror(opt, "expects a numerical value", flags);
return 0; return 0;
case OPTION_END:
case OPTION_ARGUMENT:
case OPTION_GROUP:
default: default:
die("should not happen, someone must be hit on the forehead"); die("should not happen, someone must be hit on the forehead");
} }
...@@ -296,6 +305,8 @@ int parse_options_step(struct parse_opt_ctx_t *ctx, ...@@ -296,6 +305,8 @@ int parse_options_step(struct parse_opt_ctx_t *ctx,
return parse_options_usage(usagestr, options); return parse_options_usage(usagestr, options);
case -2: case -2:
goto unknown; goto unknown;
default:
break;
} }
if (ctx->opt) if (ctx->opt)
check_typos(arg + 1, options); check_typos(arg + 1, options);
...@@ -314,6 +325,8 @@ int parse_options_step(struct parse_opt_ctx_t *ctx, ...@@ -314,6 +325,8 @@ int parse_options_step(struct parse_opt_ctx_t *ctx,
ctx->argv[0] = strdup(ctx->opt - 1); ctx->argv[0] = strdup(ctx->opt - 1);
*(char *)ctx->argv[0] = '-'; *(char *)ctx->argv[0] = '-';
goto unknown; goto unknown;
default:
break;
} }
} }
continue; continue;
...@@ -336,6 +349,8 @@ int parse_options_step(struct parse_opt_ctx_t *ctx, ...@@ -336,6 +349,8 @@ int parse_options_step(struct parse_opt_ctx_t *ctx,
return parse_options_usage(usagestr, options); return parse_options_usage(usagestr, options);
case -2: case -2:
goto unknown; goto unknown;
default:
break;
} }
continue; continue;
unknown: unknown:
...@@ -456,6 +471,13 @@ int usage_with_options_internal(const char * const *usagestr, ...@@ -456,6 +471,13 @@ int usage_with_options_internal(const char * const *usagestr,
} }
break; break;
default: /* OPTION_{BIT,BOOLEAN,SET_INT,SET_PTR} */ default: /* OPTION_{BIT,BOOLEAN,SET_INT,SET_PTR} */
case OPTION_END:
case OPTION_GROUP:
case OPTION_BIT:
case OPTION_BOOLEAN:
case OPTION_SET_INT:
case OPTION_SET_PTR:
case OPTION_LONG:
break; break;
} }
......
...@@ -17,7 +17,7 @@ static char bad_path[] = "/bad-path/"; ...@@ -17,7 +17,7 @@ static char bad_path[] = "/bad-path/";
* Two hacks: * Two hacks:
*/ */
static char *get_perf_dir(void) static const char *get_perf_dir(void)
{ {
return "."; return ".";
} }
...@@ -38,8 +38,9 @@ size_t strlcpy(char *dest, const char *src, size_t size) ...@@ -38,8 +38,9 @@ size_t strlcpy(char *dest, const char *src, size_t size)
static char *get_pathname(void) static char *get_pathname(void)
{ {
static char pathname_array[4][PATH_MAX]; static char pathname_array[4][PATH_MAX];
static int index; static int idx;
return pathname_array[3 & ++index];
return pathname_array[3 & ++idx];
} }
static char *cleanup_path(char *path) static char *cleanup_path(char *path)
...@@ -161,20 +162,24 @@ int perf_mkstemp(char *path, size_t len, const char *template) ...@@ -161,20 +162,24 @@ int perf_mkstemp(char *path, size_t len, const char *template)
} }
const char *make_relative_path(const char *abs, const char *base) const char *make_relative_path(const char *abs_path, const char *base)
{ {
static char buf[PATH_MAX + 1]; static char buf[PATH_MAX + 1];
int baselen; int baselen;
if (!base) if (!base)
return abs; return abs_path;
baselen = strlen(base); baselen = strlen(base);
if (prefixcmp(abs, base)) if (prefixcmp(abs_path, base))
return abs; return abs_path;
if (abs[baselen] == '/') if (abs_path[baselen] == '/')
baselen++; baselen++;
else if (base[baselen - 1] != '/') else if (base[baselen - 1] != '/')
return abs; return abs_path;
strcpy(buf, abs + baselen);
strcpy(buf, abs_path + baselen);
return buf; return buf;
} }
......
...@@ -262,7 +262,7 @@ int run_hook(const char *index_file, const char *name, ...) ...@@ -262,7 +262,7 @@ int run_hook(const char *index_file, const char *name, ...)
{ {
struct child_process hook; struct child_process hook;
const char **argv = NULL, *env[2]; const char **argv = NULL, *env[2];
char index[PATH_MAX]; char idx[PATH_MAX];
va_list args; va_list args;
int ret; int ret;
size_t i = 0, alloc = 0; size_t i = 0, alloc = 0;
...@@ -284,8 +284,8 @@ int run_hook(const char *index_file, const char *name, ...) ...@@ -284,8 +284,8 @@ int run_hook(const char *index_file, const char *name, ...)
hook.no_stdin = 1; hook.no_stdin = 1;
hook.stdout_to_stderr = 1; hook.stdout_to_stderr = 1;
if (index_file) { if (index_file) {
snprintf(index, sizeof(index), "PERF_INDEX_FILE=%s", index_file); snprintf(idx, sizeof(idx), "PERF_INDEX_FILE=%s", index_file);
env[0] = index; env[0] = idx;
env[1] = NULL; env[1] = NULL;
hook.env = env; hook.env = env;
} }
......
This diff is collapsed.
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/rbtree.h> #include <linux/rbtree.h>
#include "module.h" #include "module.h"
#include "event.h"
#ifdef HAVE_CPLUS_DEMANGLE #ifdef HAVE_CPLUS_DEMANGLE
extern char *cplus_demangle(const char *, int); extern char *cplus_demangle(const char *, int);
...@@ -54,7 +55,7 @@ struct dso { ...@@ -54,7 +55,7 @@ struct dso {
char name[0]; char name[0];
}; };
const char *sym_hist_filter; extern const char *sym_hist_filter;
typedef int (*symbol_filter_t)(struct dso *self, struct symbol *sym); typedef int (*symbol_filter_t)(struct dso *self, struct symbol *sym);
...@@ -72,9 +73,20 @@ int dso__load_kernel(struct dso *self, const char *vmlinux, ...@@ -72,9 +73,20 @@ int dso__load_kernel(struct dso *self, const char *vmlinux,
symbol_filter_t filter, int verbose, int modules); symbol_filter_t filter, int verbose, int modules);
int dso__load_modules(struct dso *self, symbol_filter_t filter, int verbose); int dso__load_modules(struct dso *self, symbol_filter_t filter, int verbose);
int dso__load(struct dso *self, symbol_filter_t filter, int verbose); int dso__load(struct dso *self, symbol_filter_t filter, int verbose);
struct dso *dsos__findnew(const char *name);
void dsos__fprintf(FILE *fp);
size_t dso__fprintf(struct dso *self, FILE *fp); size_t dso__fprintf(struct dso *self, FILE *fp);
char dso__symtab_origin(const struct dso *self); char dso__symtab_origin(const struct dso *self);
int load_kernel(void);
void symbol__init(void); void symbol__init(void);
extern struct list_head dsos;
extern struct dso *kernel_dso;
extern struct dso *vdso;
extern struct dso *hypervisor_dso;
extern const char *vmlinux_name;
extern int modules;
#endif /* _PERF_SYMBOL_ */ #endif /* _PERF_SYMBOL_ */
This diff is collapsed.
#include <linux/rbtree.h>
#include <linux/list.h>
#include <unistd.h>
#include "symbol.h"
struct thread {
struct rb_node rb_node;
struct list_head maps;
pid_t pid;
char *comm;
};
int thread__set_comm(struct thread *self, const char *comm);
struct thread *
threads__findnew(pid_t pid, struct rb_root *threads, struct thread **last_match);
struct thread *
register_idle_thread(struct rb_root *threads, struct thread **last_match);
void thread__insert_map(struct thread *self, struct map *map);
int thread__fork(struct thread *self, struct thread *parent);
struct map *thread__find_map(struct thread *self, u64 ip);
size_t threads__fprintf(FILE *fp, struct rb_root *threads);
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -39,10 +39,6 @@ ...@@ -39,10 +39,6 @@
/* Approximation of the length of the decimal representation of this type. */ /* Approximation of the length of the decimal representation of this type. */
#define decimal_length(x) ((int)(sizeof(x) * 2.56 + 0.5) + 1) #define decimal_length(x) ((int)(sizeof(x) * 2.56 + 0.5) + 1)
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && !defined(_M_UNIX)
#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
#endif
#define _ALL_SOURCE 1 #define _ALL_SOURCE 1
#define _GNU_SOURCE 1 #define _GNU_SOURCE 1
#define _BSD_SOURCE 1 #define _BSD_SOURCE 1
...@@ -83,6 +79,7 @@ ...@@ -83,6 +79,7 @@
#include <inttypes.h> #include <inttypes.h>
#include "../../../include/linux/magic.h" #include "../../../include/linux/magic.h"
#ifndef NO_ICONV #ifndef NO_ICONV
#include <iconv.h> #include <iconv.h>
#endif #endif
...@@ -310,6 +307,7 @@ static inline int has_extension(const char *filename, const char *ext) ...@@ -310,6 +307,7 @@ static inline int has_extension(const char *filename, const char *ext)
#undef isspace #undef isspace
#undef isdigit #undef isdigit
#undef isalpha #undef isalpha
#undef isprint
#undef isalnum #undef isalnum
#undef tolower #undef tolower
#undef toupper #undef toupper
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment