/*
* builtin-report.c
*
* Builtin report command: Analyze the perf.data input file,
* look up and read DSOs and symbol information and display
* a histogram of results, along various sorting keys.
*/
#include "builtin.h"
#include "util/util.h"
#include "util/color.h"
#include "util/list.h"
#include "util/cache.h"
#include "util/rbtree.h"
#include "util/symbol.h"
#include "util/string.h"
#include "perf.h"
#include "util/parse-options.h"
#include "util/parse-events.h"
#define SHOW_KERNEL 1
#define SHOW_USER 2
#define SHOW_HV 4
static char const *input_name = "perf.data";
static char *vmlinux = NULL;
static char default_sort_order[] = "comm,dso";
static char *sort_order = default_sort_order;
static int input;
static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV;
static int dump_trace = 0;
#define dprintf(x...) do { if (dump_trace) printf(x); } while (0)
#define cdprintf(x...) do { if (dump_trace) color_fprintf(stdout, color, x); } while (0)
static int verbose;
static int full_paths;
static unsigned long page_size;
static unsigned long mmap_window = 32;
struct ip_chain_event {
__u16 nr;
__u16 hv;
__u16 kernel;
__u16 user;
__u64 ips[];
};
struct ip_event {
struct perf_event_header header;
__u64 ip;
__u32 pid, tid;
unsigned char __more_data[];
};
struct mmap_event {
struct perf_event_header header;
__u32 pid, tid;
__u64 start;
__u64 len;
__u64 pgoff;
char filename[PATH_MAX];
};
struct comm_event {
struct perf_event_header header;
__u32 pid, tid;
char comm[16];
};
struct fork_event {
struct perf_event_header header;
__u32 pid, ppid;
};