Browse files

GCC: Attempt to fix GCC 4.62 Compile Error

  • Loading branch information...
1 parent 48b2d2d commit 367cd5e2e82c8951f2146c30b0f835e8a5598094 @burstlam burstlam committed with Dec 13, 2011
View
2 tools/perf/bench/sched-pipe.c
@@ -55,7 +55,7 @@ int bench_sched_pipe(int argc, const char **argv,
* discarding returned value of read(), write()
* causes error in building environment for perf
*/
- int ret, wait_stat;
+ int __used ret, wait_stat;
pid_t pid, retpid;
argc = parse_options(argc, argv, options,
View
12 tools/perf/builtin-sched.c
@@ -369,11 +369,6 @@ static void
process_sched_event(struct task_desc *this_task __used, struct sched_atom *atom)
{
int ret = 0;
- u64 now;
- long long delta;
-
- now = get_nsecs();
- delta = start_time + atom->timestamp - now;
switch (atom->type) {
case SCHED_EVENT_RUN:
@@ -561,7 +556,7 @@ static void wait_for_tasks(void)
static void run_one_test(void)
{
- u64 T0, T1, delta, avg_delta, fluct, std_dev;
+ u64 T0, T1, delta, avg_delta, fluct;
T0 = get_nsecs();
wait_for_tasks();
@@ -577,7 +572,6 @@ static void run_one_test(void)
else
fluct = delta - avg_delta;
sum_fluct += fluct;
- std_dev = sum_fluct / nr_runs / sqrt(nr_runs);
if (!run_avg)
run_avg = delta;
run_avg = (run_avg*9 + delta)/10;
@@ -798,7 +792,7 @@ replay_switch_event(struct trace_switch_event *switch_event,
u64 timestamp,
struct thread *thread __used)
{
- struct task_desc *prev, *next;
+ struct task_desc *prev, __used *next;
u64 timestamp0;
s64 delta;
@@ -1403,7 +1397,7 @@ map_switch_event(struct trace_switch_event *switch_event,
u64 timestamp,
struct thread *thread __used)
{
- struct thread *sched_out, *sched_in;
+ struct thread *sched_out __used, *sched_in;
int new_shortname;
u64 timestamp0;
s64 delta;
View
5 tools/perf/builtin-top.c
@@ -180,7 +180,6 @@ static int parse_source(struct sym_entry *syme)
FILE *file;
char command[PATH_MAX*2];
const char *path;
- u64 len;
if (!syme)
return -1;
@@ -209,8 +208,6 @@ static int parse_source(struct sym_entry *syme)
}
path = map->dso->long_name;
- len = sym->end - sym->start;
-
sprintf(command,
"objdump --start-address=%#0*Lx --stop-address=%#0*Lx -dS %s",
BITS_PER_LONG / 4, map__rip_2objdump(map, sym->start),
@@ -1282,7 +1279,7 @@ static int __cmd_top(void)
{
pthread_t thread;
int i, counter;
- int ret;
+ int i, ret __used;
/*
* FIXME: perf_session__new should allow passing a O_MMAP, so that all this
* mmap reading, etc is encapsulated in it. Use O_WRONLY for now.
View
2 tools/perf/util/header.c
@@ -1104,7 +1104,7 @@ int event__synthesize_tracing_data(int fd, struct perf_event_attr *pattrs,
{
event_t ev;
ssize_t size = 0, aligned_size = 0, padding;
- int err = 0;
+ int err __used = 0;
memset(&ev, 0, sizeof(ev));
View
4 tools/perf/util/hist.c
@@ -1009,7 +1009,7 @@ int hist_entry__annotate(struct hist_entry *self, struct list_head *head)
char command[PATH_MAX * 2];
FILE *file;
int err = 0;
- u64 len;
+ char symfs_filename[PATH_MAX];
if (filename == NULL) {
if (dso->has_build_id) {
@@ -1046,8 +1046,6 @@ int hist_entry__annotate(struct hist_entry *self, struct list_head *head)
filename, sym->name, map->unmap_ip(map, sym->start),
map->unmap_ip(map, sym->end));
- len = sym->end - sym->start;
-
pr_debug("annotating [%p] %30s : [%p] %30s\n",
dso, dso->long_name, sym, sym->name);
View
3 tools/perf/util/scripting-engines/trace-event-python.c
@@ -248,8 +248,7 @@ static void python_process_event(int cpu, void *data,
context = PyCObject_FromVoidPtr(scripting_context, NULL);
PyTuple_SetItem(t, n++, PyString_FromString(handler_name));
- PyTuple_SetItem(t, n++,
- PyCObject_FromVoidPtr(scripting_context, NULL));
+ PyTuple_SetItem(t, n++, context);
if (handler) {
PyTuple_SetItem(t, n++, PyInt_FromLong(cpu));
View
4 tools/perf/util/symbol.c
@@ -1358,8 +1358,8 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
snprintf(name, size, "%s", self->long_name);
break;
case DSO__ORIG_GUEST_KMODULE:
- if (map->groups && map->groups->machine)
- root_dir = map->groups->machine->root_dir;
+ if (map->groups && machine)
+ root_dir = machine->root_dir;
else
root_dir = "";
snprintf(name, size, "%s%s", root_dir, self->long_name);
View
2 tools/perf/util/trace-event-parse.c
@@ -153,7 +153,7 @@ void parse_proc_kallsyms(char *file, unsigned int size __unused)
char *next = NULL;
char *addr_str;
char ch;
- int ret;
+ int ret __used;
int i;
line = strtok_r(file, "\n", &next);

0 comments on commit 367cd5e

Please sign in to comment.