Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: some compiler warnings (func def. w/o decl.) #1887

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions driver/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ struct event_data_t {
/* Here we save only the child task struct since it is the
* unique parameter we will use in our `f_sched_prog_fork`
* filler. On the other side the `f_sched_prog_exec` filler
* won't need any tracepoint parameter so we don't need a
* won't need any tracepoint parameter so we don't need a
* internal struct here.
*/
struct {
Expand Down Expand Up @@ -597,7 +597,7 @@ static int ppm_release(struct inode *inode, struct file *filp)
ring->info->n_drops_buffer_dir_file_exit,
ring->info->n_drops_buffer_other_interest_enter,
ring->info->n_drops_buffer_other_interest_exit,
ring->info->n_drops_buffer_close_exit,
ring->info->n_drops_buffer_close_exit,
ring->info->n_drops_buffer_proc_exit,
ring->info->n_drops_pf,
ring->info->n_preemptions,
Expand Down Expand Up @@ -1527,7 +1527,7 @@ static inline void drops_buffer_syscall_categories_counters(ppm_event_code event
break;
case PPME_PROCEXIT_1_E:
ring_info->n_drops_buffer_proc_exit++;
break;
break;
// exit
case PPME_SYSCALL_OPEN_X:
case PPME_SYSCALL_CREAT_X:
Expand Down Expand Up @@ -1965,7 +1965,7 @@ static int record_event_consumer(struct ppm_consumer_t *consumer,
/*
* Fire the filler callback
*/

/* For events with category `PPMC_SCHED_PROC_EXEC` or `PPMC_SCHED_PROC_FORK`
* we need to call dedicated fillers that are not in our `g_ppm_events` table.
*/
Expand All @@ -1987,11 +1987,11 @@ static int record_event_consumer(struct ppm_consumer_t *consumer,
#endif

default:
if (likely(g_ppm_events[event_type].filler_callback))
if (likely(g_ppm_events[event_type].filler_callback))
{
cbres = g_ppm_events[event_type].filler_callback(&args);
}
else
}
else
{
pr_err("corrupted filler for event type %d: NULL callback\n", event_type);
ASSERT(0);
Expand Down Expand Up @@ -2183,7 +2183,7 @@ TRACEPOINT_PROBE(syscall_enter_probe, struct pt_regs *regs, long id)
#else
// Unsupported arch
return;
#endif
#endif
}
else
{
Expand Down Expand Up @@ -2264,7 +2264,7 @@ TRACEPOINT_PROBE(syscall_exit_probe, struct pt_regs *regs, long ret)
* tracing about to attempt one, returns the system call number.
* If @task is not executing a system call, i.e. it's blocked
* inside the kernel for a fault or signal, returns -1.
*
*
* The syscall id could be overwritten if we are in a socket call.
*/
event_data.event_info.syscall_data.id = syscall_get_nr(current, regs);
Expand Down Expand Up @@ -2488,7 +2488,7 @@ TRACEPOINT_PROBE(sched_proc_exec_probe, struct task_struct *p, pid_t old_pid, st
event_data.category = PPMC_SCHED_PROC_EXEC;
record_event_all_consumers(PPME_SYSCALL_EXECVE_19_X, UF_NEVER_DROP, &event_data, KMOD_PROG_SCHED_PROC_EXEC);
}
#endif
#endif

#ifdef CAPTURE_SCHED_PROC_FORK
TRACEPOINT_PROBE(sched_proc_fork_probe, struct task_struct *parent, struct task_struct *child)
Expand All @@ -2497,7 +2497,7 @@ TRACEPOINT_PROBE(sched_proc_fork_probe, struct task_struct *parent, struct task_

g_n_tracepoint_hit_inc();

/* We are not interested in kernel threads.
/* We are not interested in kernel threads.
* The current thread here is the `parent`.
*/
if(unlikely(current->flags & PF_KTHREAD))
Expand Down Expand Up @@ -2646,7 +2646,7 @@ static void visit_tracepoint(struct tracepoint *tp, void *priv)

#ifdef CAPTURE_SCHED_PROC_FORK
else if (!strcmp(tp->name, kmod_prog_names[KMOD_PROG_SCHED_PROC_FORK]))
tp_sched_proc_fork = tp;
tp_sched_proc_fork = tp;
#endif
}

Expand Down Expand Up @@ -2826,7 +2826,7 @@ static struct notifier_block cpu_notifier = {
};
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) */

int scap_init(void)
static int scap_init(void)
{
dev_t dev;
unsigned int cpu;
Expand Down Expand Up @@ -2989,7 +2989,7 @@ int scap_init(void)
return ret;
}

void scap_exit(void)
static void scap_exit(void)
{
int j;

Expand Down Expand Up @@ -3038,7 +3038,7 @@ static int set_g_buffer_bytes_dim(const char *val, const struct kernel_param *kp

/* `kstrtoul` is defined only on these kernels.
* https://elixir.bootlin.com/linux/v2.6.39/source/include/linux/kernel.h#L197
*/
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)
int ret = 0;
ret = kstrtoul(val, 10, &dim);
Expand All @@ -3048,7 +3048,7 @@ static int set_g_buffer_bytes_dim(const char *val, const struct kernel_param *kp
return -EINVAL;
}
#else
/* You can find more info about the simple_strtoull behavior here!
/* You can find more info about the simple_strtoull behavior here!
* https://elixir.bootlin.com/linux/latest/source/arch/x86/boot/string.c#L120
*/
char* endp = NULL;
Expand Down
Loading
Loading