Skip to content

Commit

Permalink
expend_code
Browse files Browse the repository at this point in the history
Signed-off-by: shangfan <[email protected]>
  • Loading branch information
sf1999817 committed May 16, 2024
1 parent 75034fb commit 62c96d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ int BPF_KPROBE(vfs_write)
e->pid = pid;
}
bpf_ringbuf_submit(e,0);

return 0;
}
4 changes: 2 additions & 2 deletions eBPF_Supermarket/Filesystem_Subsystem/fs_watcher/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ static int write_event(void *ctx, void *data, size_t data_sz)
time(&t);
tm = localtime(&t);
strftime(ts, sizeof(ts), "%H:%M:%S", tm);
printf("%-8s %-7ld %-7ld\n", ts, e->pid,e->fd);
printf("%-8s %-7ld %-7ld\n", ts, e->pid,e->fd);
return 0;
}

int main(int argc, char **argv)
{
struct ring_buffer *rb = NULL;
struct write_bpf *skel;
int err;
int err;

/* Set up libbpf errors and debug info callback */
libbpf_set_print(libbpf_print_fn);
Expand Down

0 comments on commit 62c96d0

Please sign in to comment.