diff options
| -rw-r--r-- | scripts/recordmcount.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c index 7f7f7180fe24..26e1271259ba 100644 --- a/scripts/recordmcount.c +++ b/scripts/recordmcount.c | |||
| @@ -313,12 +313,30 @@ do_file(char const *const fname) | |||
| 313 | int | 313 | int |
| 314 | main(int argc, char const *argv[]) | 314 | main(int argc, char const *argv[]) |
| 315 | { | 315 | { |
| 316 | const char ftrace[] = "kernel/trace/ftrace.o"; | ||
| 317 | int ftrace_size = sizeof(ftrace) - 1; | ||
| 316 | int n_error = 0; /* gcc-4.3.0 false positive complaint */ | 318 | int n_error = 0; /* gcc-4.3.0 false positive complaint */ |
| 317 | if (argc <= 1) | 319 | |
| 320 | if (argc <= 1) { | ||
| 318 | fprintf(stderr, "usage: recordmcount file.o...\n"); | 321 | fprintf(stderr, "usage: recordmcount file.o...\n"); |
| 319 | else /* Process each file in turn, allowing deep failure. */ | 322 | return 0; |
| 323 | } | ||
| 324 | |||
| 325 | /* Process each file in turn, allowing deep failure. */ | ||
| 320 | for (--argc, ++argv; 0 < argc; --argc, ++argv) { | 326 | for (--argc, ++argv; 0 < argc; --argc, ++argv) { |
| 321 | int const sjval = setjmp(jmpenv); | 327 | int const sjval = setjmp(jmpenv); |
| 328 | int len; | ||
| 329 | |||
| 330 | /* | ||
| 331 | * The file kernel/trace/ftrace.o references the mcount | ||
| 332 | * function but does not call it. Since ftrace.o should | ||
| 333 | * not be traced anyway, we just skip it. | ||
| 334 | */ | ||
| 335 | len = strlen(argv[0]); | ||
| 336 | if (len >= ftrace_size && | ||
| 337 | strcmp(argv[0] + (len - ftrace_size), ftrace) == 0) | ||
| 338 | continue; | ||
| 339 | |||
| 322 | switch (sjval) { | 340 | switch (sjval) { |
| 323 | default: { | 341 | default: { |
| 324 | fprintf(stderr, "internal error: %s\n", argv[0]); | 342 | fprintf(stderr, "internal error: %s\n", argv[0]); |
