Skip to content

Commit

Permalink
fix(bpf): address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo committed May 20, 2024
1 parent 46324e7 commit a2fa8e9
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions driver/bpf/fillers.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,24 @@ or GPL2.txt for full copies of the license.
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
#include <linux/time32.h>
struct timespec {
int32_t tv_sec;
int32_t tv_nsec;
};

struct timeval {
int32_t tv_sec;
int32_t tv_usec;
};
struct timespec {
int32_t tv_sec;
int32_t tv_nsec;
};

struct timeval {
int32_t tv_sec;
int32_t tv_usec;
};
typedef struct old_timespec32 old_timespec32;
#else
#if __has_include(<linux/time32.h>)
#include <linux/time32.h>
#else
#include <linux/compat.h>
#endif
#define timeval64 timeval
#define old_timespec32 compat_timespec
typedef struct compat_timespec old_timespec32;
#endif

#define FILLER_RAW(x) \
Expand Down Expand Up @@ -952,7 +953,7 @@ static __always_inline int timespec_parse(struct filler_data *data,
}
else
{
struct old_timespec32 ts = {};
old_timespec32 ts = {};
bpf_probe_read_user(&ts, sizeof(ts), (void *)val);
return bpf_push_u64_to_ring(data, ((uint32_t)ts.tv_sec) * 1000000000 + ts.tv_nsec);
}
Expand Down

0 comments on commit a2fa8e9

Please sign in to comment.