Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232302
b: refs/heads/master
c: 9486aa3
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed Jan 23, 2011
1 parent 3ee63b9 commit 8aa468b
Show file tree
Hide file tree
Showing 24 changed files with 94 additions and 83 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 57b84e53171ce672683faf1cab2e660965a6bdaf
refs/heads/master: 9486aa38771661e96fbb51c549b9901b5df609d8
6 changes: 3 additions & 3 deletions trunk/tools/perf/builtin-annotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ get_source_line(struct hist_entry *he, int len, const char *filename)
continue;

offset = start + i;
sprintf(cmd, "addr2line -e %s %016llx", filename, offset);
sprintf(cmd, "addr2line -e %s %016" PRIx64, filename, offset);
fp = popen(cmd, "r");
if (!fp)
continue;
Expand Down Expand Up @@ -270,9 +270,9 @@ static void hist_entry__print_hits(struct hist_entry *self)

for (offset = 0; offset < len; ++offset)
if (h->ip[offset] != 0)
printf("%*Lx: %Lu\n", BITS_PER_LONG / 2,
printf("%*" PRIx64 ": %" PRIu64 "\n", BITS_PER_LONG / 2,
sym->start + offset, h->ip[offset]);
printf("%*s: %Lu\n", BITS_PER_LONG / 2, "h->sum", h->sum);
printf("%*s: %" PRIu64 "\n", BITS_PER_LONG / 2, "h->sum", h->sum);
}

static int hist_entry__tty_annotate(struct hist_entry *he)
Expand Down
4 changes: 2 additions & 2 deletions trunk/tools/perf/builtin-kmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,10 @@ static void __print_result(struct rb_root *root, struct perf_session *session,
addr = data->ptr;

if (sym != NULL)
snprintf(buf, sizeof(buf), "%s+%Lx", sym->name,
snprintf(buf, sizeof(buf), "%s+%" PRIx64 "", sym->name,
addr - map->unmap_ip(map, sym->start));
else
snprintf(buf, sizeof(buf), "%#Lx", addr);
snprintf(buf, sizeof(buf), "%#" PRIx64 "", addr);
printf(" %-34s |", buf);

printf(" %9llu/%-5lu | %9llu/%-5lu | %8lu | %8lu | %6.3f%%\n",
Expand Down
6 changes: 3 additions & 3 deletions trunk/tools/perf/builtin-lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,9 +782,9 @@ static void print_result(void)
pr_info("%10u ", st->nr_acquired);
pr_info("%10u ", st->nr_contended);

pr_info("%15llu ", st->wait_time_total);
pr_info("%15llu ", st->wait_time_max);
pr_info("%15llu ", st->wait_time_min == ULLONG_MAX ?
pr_info("%15" PRIu64 " ", st->wait_time_total);
pr_info("%15" PRIu64 " ", st->wait_time_max);
pr_info("%15" PRIu64 " ", st->wait_time_min == ULLONG_MAX ?
0 : st->wait_time_min);
pr_info("\n");
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ static int __cmd_record(int argc, const char **argv)
* Approximate RIP event size: 24 bytes.
*/
fprintf(stderr,
"[ perf record: Captured and wrote %.3f MB %s (~%lld samples) ]\n",
"[ perf record: Captured and wrote %.3f MB %s (~%" PRIu64 " samples) ]\n",
(double)bytes_written / 1024.0 / 1024.0,
output_name,
bytes_written / 24);
Expand Down
2 changes: 1 addition & 1 deletion trunk/tools/perf/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ static int process_read_event(event_t *event, struct sample_data *sample __used,
event->read.value);
}

dump_printf(": %d %d %s %Lu\n", event->read.pid, event->read.tid,
dump_printf(": %d %d %s %" PRIu64 "\n", event->read.pid, event->read.tid,
attr ? __event_name(attr->type, attr->config) : "FAIL",
event->read.value);

Expand Down
20 changes: 10 additions & 10 deletions trunk/tools/perf/builtin-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ static void calibrate_run_measurement_overhead(void)
}
run_measurement_overhead = min_delta;

printf("run measurement overhead: %Ld nsecs\n", min_delta);
printf("run measurement overhead: %" PRIu64 " nsecs\n", min_delta);
}

static void calibrate_sleep_measurement_overhead(void)
Expand All @@ -211,7 +211,7 @@ static void calibrate_sleep_measurement_overhead(void)
min_delta -= 10000;
sleep_measurement_overhead = min_delta;

printf("sleep measurement overhead: %Ld nsecs\n", min_delta);
printf("sleep measurement overhead: %" PRIu64 " nsecs\n", min_delta);
}

static struct sched_atom *
Expand Down Expand Up @@ -617,13 +617,13 @@ static void test_calibrations(void)
burn_nsecs(1e6);
T1 = get_nsecs();

printf("the run test took %Ld nsecs\n", T1-T0);
printf("the run test took %" PRIu64 " nsecs\n", T1 - T0);

T0 = get_nsecs();
sleep_nsecs(1e6);
T1 = get_nsecs();

printf("the sleep test took %Ld nsecs\n", T1-T0);
printf("the sleep test took %" PRIu64 " nsecs\n", T1 - T0);
}

#define FILL_FIELD(ptr, field, event, data) \
Expand Down Expand Up @@ -816,10 +816,10 @@ replay_switch_event(struct trace_switch_event *switch_event,
delta = 0;

if (delta < 0)
die("hm, delta: %Ld < 0 ?\n", delta);
die("hm, delta: %" PRIu64 " < 0 ?\n", delta);

if (verbose) {
printf(" ... switch from %s/%d to %s/%d [ran %Ld nsecs]\n",
printf(" ... switch from %s/%d to %s/%d [ran %" PRIu64 " nsecs]\n",
switch_event->prev_comm, switch_event->prev_pid,
switch_event->next_comm, switch_event->next_pid,
delta);
Expand Down Expand Up @@ -1048,7 +1048,7 @@ latency_switch_event(struct trace_switch_event *switch_event,
delta = 0;

if (delta < 0)
die("hm, delta: %Ld < 0 ?\n", delta);
die("hm, delta: %" PRIu64 " < 0 ?\n", delta);


sched_out = perf_session__findnew(session, switch_event->prev_pid);
Expand Down Expand Up @@ -1221,7 +1221,7 @@ static void output_lat_thread(struct work_atoms *work_list)

avg = work_list->total_lat / work_list->nb_atoms;

printf("|%11.3f ms |%9llu | avg:%9.3f ms | max:%9.3f ms | max at: %9.6f s\n",
printf("|%11.3f ms |%9" PRIu64 " | avg:%9.3f ms | max:%9.3f ms | max at: %9.6f s\n",
(double)work_list->total_runtime / 1e6,
work_list->nb_atoms, (double)avg / 1e6,
(double)work_list->max_lat / 1e6,
Expand Down Expand Up @@ -1423,7 +1423,7 @@ map_switch_event(struct trace_switch_event *switch_event,
delta = 0;

if (delta < 0)
die("hm, delta: %Ld < 0 ?\n", delta);
die("hm, delta: %" PRIu64 " < 0 ?\n", delta);


sched_out = perf_session__findnew(session, switch_event->prev_pid);
Expand Down Expand Up @@ -1713,7 +1713,7 @@ static void __cmd_lat(void)
}

printf(" -----------------------------------------------------------------------------------------\n");
printf(" TOTAL: |%11.3f ms |%9Ld |\n",
printf(" TOTAL: |%11.3f ms |%9" PRIu64 " |\n",
(double)all_runtime/1e6, all_count);

printf(" ---------------------------------------------------\n");
Expand Down
6 changes: 3 additions & 3 deletions trunk/tools/perf/builtin-script.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ static int process_sample_event(event_t *event, struct sample_data *sample,
if (session->sample_type & PERF_SAMPLE_RAW) {
if (debug_mode) {
if (sample->time < last_timestamp) {
pr_err("Samples misordered, previous: %llu "
"this: %llu\n", last_timestamp,
pr_err("Samples misordered, previous: %" PRIu64
" this: %" PRIu64 "\n", last_timestamp,
sample->time);
nr_unordered++;
}
Expand Down Expand Up @@ -126,7 +126,7 @@ static int __cmd_script(struct perf_session *session)
ret = perf_session__process_events(session, &event_ops);

if (debug_mode)
pr_err("Misordered timestamps: %llu\n", nr_unordered);
pr_err("Misordered timestamps: %" PRIu64 "\n", nr_unordered);

return ret;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/tools/perf/builtin-stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ static int read_counter_aggr(struct perf_evsel *counter)
update_stats(&ps->res_stats[i], count[i]);

if (verbose) {
fprintf(stderr, "%s: %Ld %Ld %Ld\n", event_name(counter),
count[0], count[1], count[2]);
fprintf(stderr, "%s: %" PRIu64 " %" PRIu64 " %" PRIu64 "\n",
event_name(counter), count[0], count[1], count[2]);
}

/*
Expand Down
14 changes: 7 additions & 7 deletions trunk/tools/perf/builtin-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static int test__vmlinux_matches_kallsyms(void)
if (llabs(skew) < page_size)
continue;

pr_debug("%#Lx: diff end addr for %s v: %#Lx k: %#Lx\n",
pr_debug("%#" PRIx64 ": diff end addr for %s v: %#" PRIx64 " k: %#" PRIx64 "\n",
sym->start, sym->name, sym->end, pair->end);
} else {
struct rb_node *nnd;
Expand All @@ -168,11 +168,11 @@ static int test__vmlinux_matches_kallsyms(void)
goto detour;
}

pr_debug("%#Lx: diff name v: %s k: %s\n",
pr_debug("%#" PRIx64 ": diff name v: %s k: %s\n",
sym->start, sym->name, pair->name);
}
} else
pr_debug("%#Lx: %s not on kallsyms\n", sym->start, sym->name);
pr_debug("%#" PRIx64 ": %s not on kallsyms\n", sym->start, sym->name);

err = -1;
}
Expand Down Expand Up @@ -211,10 +211,10 @@ static int test__vmlinux_matches_kallsyms(void)

if (pair->start == pos->start) {
pair->priv = 1;
pr_info(" %Lx-%Lx %Lx %s in kallsyms as",
pr_info(" %" PRIx64 "-%" PRIx64 " %" PRIx64 " %s in kallsyms as",
pos->start, pos->end, pos->pgoff, pos->dso->name);
if (pos->pgoff != pair->pgoff || pos->end != pair->end)
pr_info(": \n*%Lx-%Lx %Lx",
pr_info(": \n*%" PRIx64 "-%" PRIx64 " %" PRIx64 "",
pair->start, pair->end, pair->pgoff);
pr_info(" %s\n", pair->dso->name);
pair->priv = 1;
Expand Down Expand Up @@ -307,7 +307,7 @@ static int test__open_syscall_event(void)
}

if (evsel->counts->cpu[0].val != nr_open_calls) {
pr_debug("perf_evsel__read_on_cpu: expected to intercept %d calls, got %Ld\n",
pr_debug("perf_evsel__read_on_cpu: expected to intercept %d calls, got %" PRIu64 "\n",
nr_open_calls, evsel->counts->cpu[0].val);
goto out_close_fd;
}
Expand Down Expand Up @@ -421,7 +421,7 @@ static int test__open_syscall_event_on_all_cpus(void)

expected = nr_open_calls + cpu;
if (evsel->counts->cpu[cpu].val != expected) {
pr_debug("perf_evsel__read_on_cpu: expected to intercept %d calls on cpu %d, got %Ld\n",
pr_debug("perf_evsel__read_on_cpu: expected to intercept %d calls on cpu %d, got %" PRIu64 "\n",
expected, cpus->map[cpu], evsel->counts->cpu[cpu].val);
goto out_close_fd;
}
Expand Down
9 changes: 5 additions & 4 deletions trunk/tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <stdio.h>
#include <termios.h>
#include <unistd.h>
#include <inttypes.h>

#include <errno.h>
#include <time.h>
Expand Down Expand Up @@ -214,7 +215,7 @@ static int parse_source(struct sym_entry *syme)
len = sym->end - sym->start;

sprintf(command,
"objdump --start-address=%#0*Lx --stop-address=%#0*Lx -dS %s",
"objdump --start-address=%#0*" PRIx64 " --stop-address=%#0*" PRIx64 " -dS %s",
BITS_PER_LONG / 4, map__rip_2objdump(map, sym->start),
BITS_PER_LONG / 4, map__rip_2objdump(map, sym->end), path);

Expand Down Expand Up @@ -308,7 +309,7 @@ static void lookup_sym_source(struct sym_entry *syme)
struct source_line *line;
char pattern[PATTERN_LEN + 1];

sprintf(pattern, "%0*Lx <", BITS_PER_LONG / 4,
sprintf(pattern, "%0*" PRIx64 " <", BITS_PER_LONG / 4,
map__rip_2objdump(syme->map, symbol->start));

pthread_mutex_lock(&syme->src->lock);
Expand Down Expand Up @@ -537,7 +538,7 @@ static void print_sym_table(void)
if (nr_counters == 1 || !display_weighted) {
struct perf_evsel *first;
first = list_entry(evsel_list.next, struct perf_evsel, node);
printf("%Ld", first->attr.sample_period);
printf("%" PRIu64, (uint64_t)first->attr.sample_period);
if (freq)
printf("Hz ");
else
Expand Down Expand Up @@ -640,7 +641,7 @@ static void print_sym_table(void)

percent_color_fprintf(stdout, "%4.1f%%", pcnt);
if (verbose)
printf(" %016llx", sym->start);
printf(" %016" PRIx64, sym->start);
printf(" %-*.*s", sym_width, sym_width, sym->name);
printf(" %-*.*s\n", dso_width, dso_width,
dso_width >= syme->map->dso->long_name_len ?
Expand Down
5 changes: 3 additions & 2 deletions trunk/tools/perf/util/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,8 @@ int event__process_comm(event_t *self, struct sample_data *sample __used,
int event__process_lost(event_t *self, struct sample_data *sample __used,
struct perf_session *session)
{
dump_printf(": id:%Ld: lost:%Ld\n", self->lost.id, self->lost.lost);
dump_printf(": id:%" PRIu64 ": lost:%" PRIu64 "\n",
self->lost.id, self->lost.lost);
session->hists.stats.total_lost += self->lost.lost;
return 0;
}
Expand Down Expand Up @@ -575,7 +576,7 @@ int event__process_mmap(event_t *self, struct sample_data *sample __used,
u8 cpumode = self->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
int ret = 0;

dump_printf(" %d/%d: [%#Lx(%#Lx) @ %#Lx]: %s\n",
dump_printf(" %d/%d: [%#" PRIx64 "(%#" PRIx64 ") @ %#" PRIx64 "]: %s\n",
self->mmap.pid, self->mmap.tid, self->mmap.start,
self->mmap.len, self->mmap.pgoff, self->mmap.filename);

Expand Down
4 changes: 2 additions & 2 deletions trunk/tools/perf/util/header.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,8 +798,8 @@ static int perf_file_section__process(struct perf_file_section *self,
int feat, int fd)
{
if (lseek(fd, self->offset, SEEK_SET) == (off_t)-1) {
pr_debug("Failed to lseek to %Ld offset for feature %d, "
"continuing...\n", self->offset, feat);
pr_debug("Failed to lseek to %" PRIu64 " offset for feature "
"%d, continuing...\n", self->offset, feat);
return 0;
}

Expand Down
17 changes: 9 additions & 8 deletions trunk/tools/perf/util/hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,13 +636,13 @@ int hist_entry__snprintf(struct hist_entry *self, char *s, size_t size,
}
}
} else
ret = snprintf(s, size, sep ? "%lld" : "%12lld ", period);
ret = snprintf(s, size, sep ? "%" PRIu64 : "%12" PRIu64 " ", period);

if (symbol_conf.show_nr_samples) {
if (sep)
ret += snprintf(s + ret, size - ret, "%c%lld", *sep, period);
ret += snprintf(s + ret, size - ret, "%c%" PRIu64, *sep, period);
else
ret += snprintf(s + ret, size - ret, "%11lld", period);
ret += snprintf(s + ret, size - ret, "%11" PRIu64, period);
}

if (pair_hists) {
Expand Down Expand Up @@ -971,7 +971,7 @@ int hist_entry__inc_addr_samples(struct hist_entry *self, u64 ip)
sym_size = sym->end - sym->start;
offset = ip - sym->start;

pr_debug3("%s: ip=%#Lx\n", __func__, self->ms.map->unmap_ip(self->ms.map, ip));
pr_debug3("%s: ip=%#" PRIx64 "\n", __func__, self->ms.map->unmap_ip(self->ms.map, ip));

if (offset >= sym_size)
return 0;
Expand All @@ -980,8 +980,9 @@ int hist_entry__inc_addr_samples(struct hist_entry *self, u64 ip)
h->sum++;
h->ip[offset]++;

pr_debug3("%#Lx %s: period++ [ip: %#Lx, %#Lx] => %Ld\n", self->ms.sym->start,
self->ms.sym->name, ip, ip - self->ms.sym->start, h->ip[offset]);
pr_debug3("%#" PRIx64 " %s: period++ [ip: %#" PRIx64 ", %#" PRIx64
"] => %" PRIu64 "\n", self->ms.sym->start, self->ms.sym->name,
ip, ip - self->ms.sym->start, h->ip[offset]);
return 0;
}

Expand Down Expand Up @@ -1132,7 +1133,7 @@ int hist_entry__annotate(struct hist_entry *self, struct list_head *head,
goto out_free_filename;
}

pr_debug("%s: filename=%s, sym=%s, start=%#Lx, end=%#Lx\n", __func__,
pr_debug("%s: filename=%s, sym=%s, start=%#" PRIx64 ", end=%#" PRIx64 "\n", __func__,
filename, sym->name, map->unmap_ip(map, sym->start),
map->unmap_ip(map, sym->end));

Expand All @@ -1142,7 +1143,7 @@ int hist_entry__annotate(struct hist_entry *self, struct list_head *head,
dso, dso->long_name, sym, sym->name);

snprintf(command, sizeof(command),
"objdump --start-address=0x%016Lx --stop-address=0x%016Lx -dS -C %s|grep -v %s|expand",
"objdump --start-address=0x%016" PRIx64 " --stop-address=0x%016" PRIx64 " -dS -C %s|grep -v %s|expand",
map__rip_2objdump(map, sym->start),
map__rip_2objdump(map, sym->end),
symfs_filename, filename);
Expand Down
3 changes: 2 additions & 1 deletion trunk/tools/perf/util/map.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "symbol.h"
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -195,7 +196,7 @@ int map__overlap(struct map *l, struct map *r)

size_t map__fprintf(struct map *self, FILE *fp)
{
return fprintf(fp, " %Lx-%Lx %Lx %s\n",
return fprintf(fp, " %" PRIx64 "-%" PRIx64 " %" PRIx64 " %s\n",
self->start, self->end, self->pgoff, self->dso->name);
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/tools/perf/util/parse-events.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ const char *__event_name(int type, u64 config)
static char buf[32];

if (type == PERF_TYPE_RAW) {
sprintf(buf, "raw 0x%llx", config);
sprintf(buf, "raw 0x%" PRIx64, config);
return buf;
}

Expand Down
Loading

0 comments on commit 8aa468b

Please sign in to comment.