diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-28 13:20:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-28 13:20:25 -0500 |
commit | 6556a6743549defc32e5f90ee2cb1ecd833a44c3 (patch) | |
tree | 622306583d4a3c13235a8bfc012854c125c597f1 /tools/perf/util/trace-event-read.c | |
parent | e0d272429a34ff143bfa04ee8e29dd4eed2964c7 (diff) | |
parent | 1dd2980d990068e20045b90c424518cc7f3657ff (diff) |
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (172 commits)
perf_event, amd: Fix spinlock initialization
perf_event: Fix preempt warning in perf_clock()
perf tools: Flush maps on COMM events
perf_events, x86: Split PMU definitions into separate files
perf annotate: Handle samples not at objdump output addr boundaries
perf_events, x86: Remove superflous MSR writes
perf_events: Simplify code by removing cpu argument to hw_perf_group_sched_in()
perf_events, x86: AMD event scheduling
perf_events: Add new start/stop PMU callbacks
perf_events: Report the MMAP pgoff value in bytes
perf annotate: Defer allocating sym_priv->hist array
perf symbols: Improve debugging information about symtab origins
perf top: Use a macro instead of a constant variable
perf symbols: Check the right return variable
perf/scripts: Tag syscall_name helper as not yet available
perf/scripts: Add perf-trace-python Documentation
perf/scripts: Remove unnecessary PyTuple resizes
perf/scripts: Add syscall tracing scripts
perf/scripts: Add Python scripting engine
perf/scripts: Remove check-perf-trace from listed scripts
...
Fix trivial conflict in tools/perf/util/probe-event.c
Diffstat (limited to 'tools/perf/util/trace-event-read.c')
-rw-r--r-- | tools/perf/util/trace-event-read.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/perf/util/trace-event-read.c b/tools/perf/util/trace-event-read.c index 1744422cafcb..7cd1193918c7 100644 --- a/tools/perf/util/trace-event-read.c +++ b/tools/perf/util/trace-event-read.c | |||
@@ -18,7 +18,7 @@ | |||
18 | * | 18 | * |
19 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 19 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
20 | */ | 20 | */ |
21 | #define _LARGEFILE64_SOURCE | 21 | #define _FILE_OFFSET_BITS 64 |
22 | 22 | ||
23 | #include <dirent.h> | 23 | #include <dirent.h> |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
@@ -83,7 +83,7 @@ static char *read_string(void) | |||
83 | char *str = NULL; | 83 | char *str = NULL; |
84 | int size = 0; | 84 | int size = 0; |
85 | int i; | 85 | int i; |
86 | int r; | 86 | off_t r; |
87 | 87 | ||
88 | for (;;) { | 88 | for (;;) { |
89 | r = read(input_fd, buf, BUFSIZ); | 89 | r = read(input_fd, buf, BUFSIZ); |
@@ -118,7 +118,7 @@ static char *read_string(void) | |||
118 | 118 | ||
119 | /* move the file descriptor to the end of the string */ | 119 | /* move the file descriptor to the end of the string */ |
120 | r = lseek(input_fd, -(r - i), SEEK_CUR); | 120 | r = lseek(input_fd, -(r - i), SEEK_CUR); |
121 | if (r < 0) | 121 | if (r == (off_t)-1) |
122 | die("lseek"); | 122 | die("lseek"); |
123 | 123 | ||
124 | if (str) { | 124 | if (str) { |
@@ -282,8 +282,8 @@ static void update_cpu_data_index(int cpu) | |||
282 | 282 | ||
283 | static void get_next_page(int cpu) | 283 | static void get_next_page(int cpu) |
284 | { | 284 | { |
285 | off64_t save_seek; | 285 | off_t save_seek; |
286 | off64_t ret; | 286 | off_t ret; |
287 | 287 | ||
288 | if (!cpu_data[cpu].page) | 288 | if (!cpu_data[cpu].page) |
289 | return; | 289 | return; |
@@ -298,17 +298,17 @@ static void get_next_page(int cpu) | |||
298 | update_cpu_data_index(cpu); | 298 | update_cpu_data_index(cpu); |
299 | 299 | ||
300 | /* other parts of the code may expect the pointer to not move */ | 300 | /* other parts of the code may expect the pointer to not move */ |
301 | save_seek = lseek64(input_fd, 0, SEEK_CUR); | 301 | save_seek = lseek(input_fd, 0, SEEK_CUR); |
302 | 302 | ||
303 | ret = lseek64(input_fd, cpu_data[cpu].offset, SEEK_SET); | 303 | ret = lseek(input_fd, cpu_data[cpu].offset, SEEK_SET); |
304 | if (ret < 0) | 304 | if (ret == (off_t)-1) |
305 | die("failed to lseek"); | 305 | die("failed to lseek"); |
306 | ret = read(input_fd, cpu_data[cpu].page, page_size); | 306 | ret = read(input_fd, cpu_data[cpu].page, page_size); |
307 | if (ret < 0) | 307 | if (ret < 0) |
308 | die("failed to read page"); | 308 | die("failed to read page"); |
309 | 309 | ||
310 | /* reset the file pointer back */ | 310 | /* reset the file pointer back */ |
311 | lseek64(input_fd, save_seek, SEEK_SET); | 311 | lseek(input_fd, save_seek, SEEK_SET); |
312 | 312 | ||
313 | return; | 313 | return; |
314 | } | 314 | } |