Skip to content

Commit 9f15fce

Browse files
Raptor Engineering Development Teammadscientist159
Raptor Engineering Development Team
authored andcommitted
Add per-file debug log enable #define
1 parent 37a7cb4 commit 9f15fce

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

src/hwpf/plat_trace.H

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,27 @@ extern "C"
4545
#include "trac_interface.h"
4646
}
4747

48+
#ifdef SBE_CONSOLE_SUPPORT
49+
#include "printf.H"
50+
#endif
51+
4852
// Why not a #define, why is this in the fapi2 namespace?
4953
// To prevent problems with Cronus and the fapi1 definitions.
5054
namespace fapi2
5155
{
5256
static const uint32_t MAX_ECMD_STRING_LEN = 64;
5357
};
5458

59+
#if defined(SBE_CONSOLE_SUPPORT) && defined(ENABLE_CONSOLE_TRACE_IN_FILE)
60+
#define FAPI_TRACE(_id_, _fmt_, _args_...) { \
61+
printf(_fmt_, ##_args_); \
62+
printf("\n\r"); \
63+
}
64+
#else
5565
// Information traces (go into fast trace buffer that can wrap often)
5666
#define FAPI_TRACE(_id_, _fmt_, _args_...) \
5767
PK_TRACE(_fmt_, ##_args_);
68+
#endif
5869

5970

6071
/* The following is a desirous trace entry but the second line has a

src/sbefw/core/sbetrace.H

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ extern "C" {
3131
#include "pk_api.h"
3232
#include "trac_interface.h"
3333

34+
#ifdef SBE_CONSOLE_SUPPORT
35+
#include "printf.H"
36+
#endif
37+
3438
#ifdef __cplusplus
3539
}
3640
#endif
@@ -47,6 +51,15 @@ extern "C" {
4751
#define SBE_EXIT(args...)
4852
#define SBE_DEBUG(args...)
4953

54+
#if defined(SBE_CONSOLE_SUPPORT) && defined(ENABLE_CONSOLE_TRACE_IN_FILE)
55+
#define PK_TRACE_INTERNAL(args...) { \
56+
printf(args); \
57+
printf("\n\r"); \
58+
}
59+
#else
60+
#define PK_TRACE_INTERNAL(args...) PK_TRACE(args)
61+
#endif
62+
5063
// Levels of logging
5164
// 0 - No tracing
5265
// 1 - Error
@@ -55,21 +68,21 @@ extern "C" {
5568
// 4 - Error, info, entry/exit, debug
5669
#if (SBE_TRACE_LEVEL >= 1)
5770
#undef SBE_ERROR
58-
#define SBE_ERROR(args...) PK_TRACE(SBE_ERR_MRK"" args)
71+
#define SBE_ERROR(args...) PK_TRACE_INTERNAL(SBE_ERR_MRK"" args)
5972
#endif
6073
#if (SBE_TRACE_LEVEL >= 2)
6174
#undef SBE_INFO
62-
#define SBE_INFO(args...) PK_TRACE(SBE_INF_MRK"" args)
75+
#define SBE_INFO(args...) PK_TRACE_INTERNAL(SBE_INF_MRK"" args)
6376
#endif
6477
#if (SBE_TRACE_LEVEL >= 3)
6578
#undef SBE_ENTER
6679
#undef SBE_EXIT
67-
#define SBE_ENTER(args...) PK_TRACE(SBE_ENTER_MRK"" args)
68-
#define SBE_EXIT(args...) PK_TRACE(SBE_EXIT_MRK"" args)
80+
#define SBE_ENTER(args...) PK_TRACE_INTERNAL(SBE_ENTER_MRK"" args)
81+
#define SBE_EXIT(args...) PK_TRACE_INTERNAL(SBE_EXIT_MRK"" args)
6982
#endif
7083
#if (SBE_TRACE_LEVEL >= 4)
7184
#undef SBE_DEBUG
72-
#define SBE_DEBUG(args...) PK_TRACE(SBE_DEBUG_MRK"" args)
85+
#define SBE_DEBUG(args...) PK_TRACE_INTERNAL(SBE_DEBUG_MRK"" args)
7386
#endif
74-
#define SBE_TRACE(args...) PK_TRACE(args)
87+
#define SBE_TRACE(args...) PK_TRACE_INTERNAL(args)
7588
#endif // __SBEFW_SBE_TRACE_H

0 commit comments

Comments
 (0)