Skip to content

Commit

Permalink
kINT: Fix build without CONFIG_TRACEPOINTS
Browse files Browse the repository at this point in the history
Fixes #334, ee41d81
  • Loading branch information
solardiz committed May 22, 2024
1 parent dbd39cc commit d327c18
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
The following major changes have been made since 0.9.8:

*) Re-support build without CONFIG_TRACEPOINTS (was broken in 0.9.8)


The following major changes have been made between LKRG 0.9.7 and 0.9.8:

*) Add optional remote kernel message logging, including the sending component
Expand Down
2 changes: 2 additions & 0 deletions src/modules/database/p_database.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ int p_create_database(void) {

P_SYM_INIT(jump_label_mutex)
P_SYM_INIT(text_mutex)
#ifdef CONFIG_TRACEPOINTS
P_SYM_INIT(tracepoints_mutex)
#endif

/*
* First gather information about CPUs in the system - CRITICAL !!!
Expand Down
4 changes: 4 additions & 0 deletions src/modules/database/p_database.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ static inline void p_text_section_lock(void) {
mutex_lock(P_SYM(p_module_mutex));
while (mutex_is_locked(P_SYM(p_jump_label_mutex)))
schedule();
#ifdef CONFIG_TRACEPOINTS
mutex_lock(P_SYM(p_tracepoints_mutex));
#endif
#if defined(P_LKRG_CI_ARCH_STATIC_CALL_TRANSFORM_H)
do {
p_lkrg_counter_lock_lock(&p_static_call_spinlock, &p_text_flags);
Expand All @@ -226,7 +228,9 @@ static inline void p_text_section_unlock(void) {
#if defined(P_LKRG_CI_ARCH_STATIC_CALL_TRANSFORM_H)
p_lkrg_counter_lock_val_dec(&p_static_call_spinlock);
#endif
#ifdef CONFIG_TRACEPOINTS
mutex_unlock(P_SYM(p_tracepoints_mutex));
#endif
/* Release the 'module_mutex' */
mutex_unlock(P_SYM(p_module_mutex));
#if defined(CONFIG_DYNAMIC_FTRACE)
Expand Down
2 changes: 2 additions & 0 deletions src/p_lkrg_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ typedef struct _p_lkrg_global_symbols_structure {
pmd_t *(*p_mm_find_pmd)(struct mm_struct *mm, unsigned long address);
struct mutex *p_jump_label_mutex;
struct mutex *p_text_mutex;
#ifdef CONFIG_TRACEPOINTS
struct mutex *p_tracepoints_mutex;
#endif
struct text_poke_loc **p_tp_vec;
int *p_tp_vec_nr;
#if defined(CONFIG_DYNAMIC_DEBUG)
Expand Down

0 comments on commit d327c18

Please sign in to comment.