summaryrefslogtreecommitdiff
path: root/tools/perf/util
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/parse-events.c10
-rw-r--r--tools/perf/util/string.c2
-rw-r--r--tools/perf/util/string.h4
-rw-r--r--tools/perf/util/symbol.c20
-rw-r--r--tools/perf/util/symbol.h15
5 files changed, 26 insertions, 25 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index f0c9f2627fe..35d04da38d6 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -13,8 +13,8 @@ int nr_counters;
struct perf_counter_attr attrs[MAX_COUNTERS];
struct event_symbol {
- __u8 type;
- __u64 config;
+ u8 type;
+ u64 config;
char *symbol;
};
@@ -96,7 +96,7 @@ static char *hw_cache_result [][MAX_ALIASES] = {
char *event_name(int counter)
{
- __u64 config = attrs[counter].config;
+ u64 config = attrs[counter].config;
int type = attrs[counter].type;
static char buf[32];
@@ -112,7 +112,7 @@ char *event_name(int counter)
return "unknown-hardware";
case PERF_TYPE_HW_CACHE: {
- __u8 cache_type, cache_op, cache_result;
+ u8 cache_type, cache_op, cache_result;
static char name[100];
cache_type = (config >> 0) & 0xff;
@@ -202,7 +202,7 @@ static int parse_generic_hw_symbols(const char *str, struct perf_counter_attr *a
*/
static int parse_event_symbols(const char *str, struct perf_counter_attr *attr)
{
- __u64 config, id;
+ u64 config, id;
int type;
unsigned int i;
const char *sep, *pstr;
diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c
index ec33c0c7f4e..c93eca9a7be 100644
--- a/tools/perf/util/string.c
+++ b/tools/perf/util/string.c
@@ -15,7 +15,7 @@ static int hex(char ch)
* While we find nice hex chars, build a long_val.
* Return number of chars processed.
*/
-int hex2u64(const char *ptr, __u64 *long_val)
+int hex2u64(const char *ptr, u64 *long_val)
{
const char *p = ptr;
*long_val = 0;
diff --git a/tools/perf/util/string.h b/tools/perf/util/string.h
index 72812c1c9a7..37b03255b42 100644
--- a/tools/perf/util/string.h
+++ b/tools/perf/util/string.h
@@ -1,8 +1,8 @@
#ifndef _PERF_STRING_H_
#define _PERF_STRING_H_
-#include <linux/types.h>
+#include "../types.h"
-int hex2u64(const char *ptr, __u64 *val);
+int hex2u64(const char *ptr, u64 *val);
#endif
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 49a55f81371..86e14375e74 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -9,9 +9,9 @@
const char *sym_hist_filter;
-static struct symbol *symbol__new(__u64 start, __u64 len,
+static struct symbol *symbol__new(u64 start, u64 len,
const char *name, unsigned int priv_size,
- __u64 obj_start, int verbose)
+ u64 obj_start, int verbose)
{
size_t namelen = strlen(name) + 1;
struct symbol *self = calloc(1, priv_size + sizeof(*self) + namelen);
@@ -21,14 +21,14 @@ static struct symbol *symbol__new(__u64 start, __u64 len,
if (verbose >= 2)
printf("new symbol: %016Lx [%08lx]: %s, hist: %p, obj_start: %p\n",
- (__u64)start, (unsigned long)len, name, self->hist, (void *)(unsigned long)obj_start);
+ (u64)start, (unsigned long)len, name, self->hist, (void *)(unsigned long)obj_start);
self->obj_start= obj_start;
self->hist = NULL;
self->hist_sum = 0;
if (sym_hist_filter && !strcmp(name, sym_hist_filter))
- self->hist = calloc(sizeof(__u64), len);
+ self->hist = calloc(sizeof(u64), len);
if (priv_size) {
memset(self, 0, priv_size);
@@ -89,7 +89,7 @@ static void dso__insert_symbol(struct dso *self, struct symbol *sym)
{
struct rb_node **p = &self->syms.rb_node;
struct rb_node *parent = NULL;
- const __u64 ip = sym->start;
+ const u64 ip = sym->start;
struct symbol *s;
while (*p != NULL) {
@@ -104,7 +104,7 @@ static void dso__insert_symbol(struct dso *self, struct symbol *sym)
rb_insert_color(&sym->rb_node, &self->syms);
}
-struct symbol *dso__find_symbol(struct dso *self, __u64 ip)
+struct symbol *dso__find_symbol(struct dso *self, u64 ip)
{
struct rb_node *n;
@@ -151,7 +151,7 @@ static int dso__load_kallsyms(struct dso *self, symbol_filter_t filter, int verb
goto out_failure;
while (!feof(file)) {
- __u64 start;
+ u64 start;
struct symbol *sym;
int line_len, len;
char symbol_type;
@@ -232,7 +232,7 @@ static int dso__load_perf_map(struct dso *self, symbol_filter_t filter, int verb
goto out_failure;
while (!feof(file)) {
- __u64 start, size;
+ u64 start, size;
struct symbol *sym;
int line_len, len;
@@ -353,7 +353,7 @@ static int dso__synthesize_plt_symbols(struct dso *self, Elf *elf,
{
uint32_t nr_rel_entries, idx;
GElf_Sym sym;
- __u64 plt_offset;
+ u64 plt_offset;
GElf_Shdr shdr_plt;
struct symbol *f;
GElf_Shdr shdr_rel_plt;
@@ -523,7 +523,7 @@ static int dso__load_sym(struct dso *self, int fd, const char *name,
elf_symtab__for_each_symbol(syms, nr_syms, index, sym) {
struct symbol *f;
- __u64 obj_start;
+ u64 obj_start;
if (!elf_sym__is_function(&sym))
continue;
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 5ad9b06c3f6..ea332e56e45 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -2,16 +2,17 @@
#define _PERF_SYMBOL_ 1
#include <linux/types.h>
+#include "../types.h"
#include "list.h"
#include "rbtree.h"
struct symbol {
struct rb_node rb_node;
- __u64 start;
- __u64 end;
- __u64 obj_start;
- __u64 hist_sum;
- __u64 *hist;
+ u64 start;
+ u64 end;
+ u64 obj_start;
+ u64 hist_sum;
+ u64 *hist;
void *priv;
char name[0];
};
@@ -20,7 +21,7 @@ struct dso {
struct list_head node;
struct rb_root syms;
unsigned int sym_priv_size;
- struct symbol *(*find_symbol)(struct dso *, __u64 ip);
+ struct symbol *(*find_symbol)(struct dso *, u64 ip);
char name[0];
};
@@ -36,7 +37,7 @@ static inline void *dso__sym_priv(struct dso *self, struct symbol *sym)
return ((void *)sym) - self->sym_priv_size;
}
-struct symbol *dso__find_symbol(struct dso *self, __u64 ip);
+struct symbol *dso__find_symbol(struct dso *self, u64 ip);
int dso__load_kernel(struct dso *self, const char *vmlinux,
symbol_filter_t filter, int verbose);