Skip to content

Commit

Permalink
bug fix && release v2.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
SeeFlowerX committed Oct 23, 2023
1 parent 8e23e22 commit 038aa66
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ coral:/data/local/tmp # readelf -s /apex/com.android.runtime/lib64/bionic/libc.s
# 交流
有关eBPF on Android系列可以[加群交流](./images/Snipaste_2023-10-16_17-30-46.png)
有关eBPF on Android系列可以[加群交流](./images/Snipaste_2023-10-23_20-32-14.png)
个人碎碎念太多,有关stackplz文章就不同步到本项目了,请移步博客查看:
Expand Down
Binary file removed images/Snipaste_2023-10-16_17-30-46.png
Binary file not shown.
Binary file added images/Snipaste_2023-10-23_20-32-14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 12 additions & 6 deletions src/common/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ static __always_inline int save_bytes_to_buf(event_data_t *event, void *ptr, u32
{
// Data saved to submit buf: [index][size][ ... bytes ... ]

if (size == 0)
return 0;
// if (size == 0)
// return 0;

if (event->buf_off > ARGS_BUF_SIZE - 1)
return 0;
Expand All @@ -67,10 +67,16 @@ static __always_inline int save_bytes_to_buf(event_data_t *event, void *ptr, u32
return 0;

// Read bytes into buffer
if (bpf_probe_read(&(event->args[event->buf_off + 1 + sizeof(int)]),
size & (MAX_BYTES_ARR_SIZE - 1),
ptr) == 0) {
// We update buf_off only if all writes were successful
if (size > 0) {
if (bpf_probe_read(&(event->args[event->buf_off + 1 + sizeof(int)]),
size & (MAX_BYTES_ARR_SIZE - 1),
ptr) == 0) {
// We update buf_off only if all writes were successful
event->buf_off += size + 1 + sizeof(int);
event->context.argnum++;
return 1;
}
} else {
event->buf_off += size + 1 + sizeof(int);
event->context.argnum++;
return 1;
Expand Down

0 comments on commit 038aa66

Please sign in to comment.