Changeset 263bda2 in mainline for kernel/generic/include/debug.h


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/generic/include/debug.h

    r793cf029 r263bda2  
    9393#define LOG(format, ...) \
    9494        do { \
    95                 printf("%s->%s() at %s:%u: " format "\n", symtab_fmt_name_lookup(CALLER), \
    96                     __func__, __FILE__, __LINE__, ##__VA_ARGS__); \
     95                printf("%s() from %s at %s:%u: " format "\n", __func__, \
     96                    symtab_fmt_name_lookup(CALLER), __FILE__, __LINE__, \
     97                    ##__VA_ARGS__); \
    9798        } while (0)
    9899
    99 /** Extensive logging execute macro
    100  *
    101  * If CONFIG_LOG is set, the LOG_EXEC() macro
    102  * will print an information about calling a given
    103  * function and call it.
    104  *
    105  */
    106 #define LOG_EXEC(fnc) \
    107         do { \
    108                 printf("%s->%s() at %s:%u: " #fnc "\n", symtab_fmt_name_lookup(CALLER), \
    109                     __func__, __FILE__, __LINE__); \
    110                 fnc; \
    111         } while (0)
     100extern void __cyg_profile_func_enter(void *, void *);
     101extern void __cyg_profile_func_exit(void *, void *);
    112102
    113103#else /* CONFIG_LOG */
    114104
    115105#define LOG(format, ...)
    116 #define LOG_EXEC(fnc)     fnc
    117106
    118 #endif /* CONFOG_LOG */
     107#endif /* CONFIG_LOG */
    119108
    120109#endif
Note: See TracChangeset for help on using the changeset viewer.