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

Merge pull request iovisor#3691 from chenhengqi/add-mdflush #3

Merged
merged 30 commits into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4f59913
libbpf-tools: Add mdflush
chenhengqi Nov 8, 2021
63103fa
bcc: add method to close file descriptors
terceiro Mar 22, 2022
9d06ced
tools/tcplife: Remove dead code
chenhengqi Jun 2, 2022
02f0f5a
Merge pull request #4032 from chenhengqi/cleanup-tcplife
davemarchevsky Jun 2, 2022
42a84ed
Fixed 'getElementType() is deprecated' compile warning.
Rtoax May 29, 2022
65efffe
tools/exitsnoop: Use task->real_parent instead of task->parent (#4025)
xingfeng2510 Jun 3, 2022
ae680db
tools/biolatency: Add disk filter support (#4026)
xingfeng2510 Jun 3, 2022
aad64e4
docs: Add missing entries for CGROUP_SOCK_ADDR family
chenhengqi Jun 2, 2022
9541c9c
sync with laest libbpf repo
yonghong-song Jun 3, 2022
730ced2
libbpf-tools: add support for cross compilation
May 13, 2022
67b8cfb
libbpf-tools/klockstat: Flush stdout after print_stats()
namhyung May 11, 2022
bfccfe6
libbpf-tools/klockstat: Print human friendly time stats
namhyung May 11, 2022
5e3d41e
libbpf-tools/klockstat: Add --per-thread/-P option
namhyung May 11, 2022
a184f09
libbpf-tools: Fix bio tools
chenhengqi Jun 10, 2022
70e8a9b
Merge pull request #3919 from terceiro/python-bpf-close
davemarchevsky Jun 13, 2022
45f5df4
libbpf-tools: Remove map flag BPF_F_NO_PREALLOC
chenhengqi Jun 10, 2022
8e608ed
Remove executable permissions and extra spaces for "funcinterval.8".
Rtoax Jun 14, 2022
e345542
Merge pull request #4049 from Rtoax/patch-17-funcinterval.8-x
davemarchevsky Jun 14, 2022
16eab39
Add tracepoint:skb:kfree_skb if no tcp_drop() kprobe.
Rtoax Jun 15, 2022
1c0808d
Fix: Failed to load BPF program b'trace_read_return': Permission denied
Rtoax Jun 15, 2022
37c3f97
libbpf-tools: fix tcpconnect build errors
aspsk Jun 15, 2022
e16b628
Add more hints for error kprobe.
Rtoax Jun 17, 2022
dbb7b83
Merge pull request #4055 from Rtoax/patch-21-warn-inlined
davemarchevsky Jun 17, 2022
e84e46f
sync with latest libbpf repo
chantra Jun 20, 2022
1900809
backport `struct bpf_create_map_attr`
chantra Jun 20, 2022
10e3cd4
tools/syscount: Beautify output of syscall list
xingfeng2510 Jun 21, 2022
13b5563
Merge pull request #4062 from chantra/remove_bpf_create_map
davemarchevsky Jun 21, 2022
a409bf5
Merge pull request #4050 from Rtoax/patch-18-tcpdrop-reason
davemarchevsky Jun 24, 2022
21e18d1
Merge pull request #4063 from xingfeng2510/enhance
davemarchevsky Jun 24, 2022
9627312
Merge pull request #3691 from chenhengqi/add-mdflush
davemarchevsky Jun 24, 2022
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
Prev Previous commit
Next Next commit
backport struct bpf_create_map_attr
Since
libbpf/libbpf@7e8d423,
this structure is gone from libbpf.

BCC uses it as a structure to pass around `bcc_create_map_xattr` and
`libbpf_bpf_map_create`.
The alternative would be to modify both libbpf_bpf_map_create and
bcc_create_map_xattr to take each arguments, which I am not sure it
would be any better.
Renamed the struct from `bpf_create_map_xattr` to `bcc_create_map_xattr` to better reflect this is a bcc-provided struct, not bpf anymore.
  • Loading branch information
chantra committed Jun 20, 2022
commit 1900809b49b66c6f58ba211504598c0d558f500a
2 changes: 1 addition & 1 deletion src/cc/bpf_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ int BPFModule::create_maps(std::map<std::string, std::pair<int, int>> &map_tids,
}

if (pinned_id <= 0) {
struct bpf_create_map_attr attr = {};
struct bcc_create_map_attr attr = {};
attr.map_type = (enum bpf_map_type)map_type;
attr.name = map_name;
attr.key_size = key_size;
Expand Down
6 changes: 3 additions & 3 deletions src/cc/libbpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ static uint64_t ptr_to_u64(void *ptr)
return (uint64_t) (unsigned long) ptr;
}

static int libbpf_bpf_map_create(struct bpf_create_map_attr *create_attr)
static int libbpf_bpf_map_create(struct bcc_create_map_attr *create_attr)
{
LIBBPF_OPTS(bpf_map_create_opts, p);

Expand All @@ -326,7 +326,7 @@ static int libbpf_bpf_map_create(struct bpf_create_map_attr *create_attr)
create_attr->value_size, create_attr->max_entries, &p);
}

int bcc_create_map_xattr(struct bpf_create_map_attr *attr, bool allow_rlimit)
int bcc_create_map_xattr(struct bcc_create_map_attr *attr, bool allow_rlimit)
{
unsigned name_len = attr->name ? strlen(attr->name) : 0;
char map_name[BPF_OBJ_NAME_LEN] = {};
Expand Down Expand Up @@ -383,7 +383,7 @@ int bcc_create_map(enum bpf_map_type map_type, const char *name,
int key_size, int value_size,
int max_entries, int map_flags)
{
struct bpf_create_map_attr attr = {};
struct bcc_create_map_attr attr = {};

attr.map_type = map_type;
attr.name = name;
Expand Down
20 changes: 18 additions & 2 deletions src/cc/libbpf.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,23 @@
extern "C" {
#endif

struct bpf_create_map_attr;
struct bcc_create_map_attr {
const char *name;
enum bpf_map_type map_type;
__u32 map_flags;
__u32 key_size;
__u32 value_size;
__u32 max_entries;
__u32 numa_node;
__u32 btf_fd;
__u32 btf_key_type_id;
__u32 btf_value_type_id;
__u32 map_ifindex;
union {
__u32 inner_map_fd;
__u32 btf_vmlinux_value_type_id;
};
};
struct bpf_load_program_attr;

enum bpf_probe_attach_type {
Expand All @@ -44,7 +60,7 @@ struct bcc_perf_buffer_opts {
int bcc_create_map(enum bpf_map_type map_type, const char *name,
int key_size, int value_size, int max_entries,
int map_flags);
int bcc_create_map_xattr(struct bpf_create_map_attr *attr, bool allow_rlimit);
int bcc_create_map_xattr(struct bcc_create_map_attr *attr, bool allow_rlimit);
int bpf_update_elem(int fd, void *key, void *value, unsigned long long flags);
int bpf_lookup_elem(int fd, void *key, void *value);
int bpf_delete_elem(int fd, void *key);
Expand Down