File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ endif
210
210
211
211
ifdef CONFIG_FTRACE_MCOUNT_RECORD
212
212
ifdef BUILD_C_RECORDMCOUNT
213
- cmd_record_mcount = $(srctree )/scripts/recordmcount "$(@)";
213
+ cmd_record_mcount = $(objtree )/scripts/recordmcount "$(@)";
214
214
else
215
215
cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \
216
216
"$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \
Original file line number Diff line number Diff line change @@ -313,12 +313,30 @@ do_file(char const *const fname)
313
313
int
314
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
318
int n_error = 0 ; /* gcc-4.3.0 false positive complaint */
317
- if (argc <= 1 )
319
+
320
+ if (argc <= 1 ) {
318
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
326
for (-- argc , ++ argv ; 0 < argc ; -- argc , ++ argv ) {
321
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
340
switch (sjval ) {
323
341
default : {
324
342
fprintf (stderr , "internal error: %s\n" , argv [0 ]);
You can’t perform that action at this time.
0 commit comments