Changeset 263bda2 in mainline for kernel/Makefile


Ignore:
Timestamp:
2010-06-30T09:10:04Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4edd57fd
Parents:
793cf029
Message:

remove LOG_EXEC() macro, use compile-time instrumentation for detailed kernel logging

  • add more files to the INSTRUMENTED_SOURCES list in kernel/Makefile where instrumentation is safe (extra care must be taken not to enable instrumentation in functions where it would lead to an infinite cycle [e.g. print functions] and where resources are limited [e.g. temporary stack])
  • even in files which are in the INSTRUMENTED_SOURCES list specific functions can be excluded from being instrumented via the attribute((no_instrument_function)) decoration
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/Makefile

    r793cf029 r263bda2  
    160160        CFLAGS = $(GCC_CFLAGS)
    161161        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
     162        INSTRUMENTATION = -finstrument-functions
    162163endif
    163164
     
    165166        CFLAGS = $(GCC_CFLAGS)
    166167        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
     168        INSTRUMENTATION = -finstrument-functions
    167169endif
    168170
     
    170172        CFLAGS = $(ICC_CFLAGS)
    171173        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
     174        INSTRUMENTATION =
    172175endif
    173176
     
    176179        DEFS += $(CONFIG_DEFS)
    177180        DEPEND_DEFS = $(DEFS)
     181        INSTRUMENTATION =
    178182endif
    179183
     
    181185        CFLAGS = $(CLANG_CFLAGS)
    182186        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
     187        INSTRUMENTATION =
    183188endif
    184189
     
    202207        generic/src/debug/stacktrace.c \
    203208        generic/src/debug/panic.c \
     209        generic/src/debug/debug.c \
    204210        generic/src/interrupt/interrupt.c \
    205211        generic/src/main/main.c \
     
    355361endif
    356362
     363## Sources where instrumentation is enabled
     364#
     365
     366ifeq ($(CONFIG_LOG),y)
     367INSTRUMENTED_SOURCES = \
     368        generic/src/cpu/cpu.c \
     369        generic/src/main/kinit.c
     370endif
     371
    357372GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
    358373ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
     
    414429
    415430%.o: %.c $(DEPEND)
    416         $(CC) $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS) -c -o $@ $<
     431        $(CC) $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS) $(if $(findstring $<,$(INSTRUMENTED_SOURCES)),$(INSTRUMENTATION)) -c -o $@ $<
    417432ifeq ($(PRECHECK),y)
    418433        $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS)
Note: See TracChangeset for help on using the changeset viewer.