Questions tagged [bcc-bpf]

Questions related to the development of BPF tools through the use of the bcc (BPF Compiler Collection) framework.

Questions related to the development of BPF tools through the use of the bcc (BPF Compiler Collection) framework.

121 questions
0
votes
1 answer

Can someone explain what exact latency is measured by biolatency tool (bcc)?

Is it: Time between the Virtual FileSystem calling the block IO layer to the time it submitting requests to the block device driver? Time between submitting requests to the block io layer to the time when the request is serviced from the disk?
0
votes
1 answer

Missing closing bracket and quotes when trying to run BPF programs

I keep getting this missing terminating character error with my code. My goal is to just print the string word by word. Here is the code. bpfprogram = """ int helloworld2(void *ctx) { const char *str = "here are some words"; int length =…
0
votes
1 answer

EBPF access pinned tables

If in my python bcc program I store information in a pinned map, how can I access it from a separate python program? So I have this pinned map from the reference guide: BPF_TABLE_PINNED("hash", u64, u64, ids, 1024, "/sys/fs/bpf/ids"); I already…
0
votes
1 answer

Possible to see tracing when using cat or vi opening a text file

Is it possible to trace through what is being read through a text file using eBPF? There are ways to see the amount of memory being used and count reads and writes but I would like to even output the user data using bpf_trace_print if possible.
Zarif Rahman
  • 79
  • 1
  • 8
0
votes
1 answer

Extracting the first two words in a sentence in C without pointers

I am getting used to writing eBPF code as of now and want to avoid using pointers in my BPF text due to how difficult it is to get a correct output out of it. Using strtok() seems to be out of the question due to all of the example codes requiring…
Zarif Rahman
  • 79
  • 1
  • 8
0
votes
0 answers

BPF crc32 wierd error: last insn is not an exit or jump

Messing around with eBPF and decided to try another crc32 algorithm to try but got stuck with another error that I can't seem to find too much information for. I keep getting a bpf: Failed to load program: Invalid argument last insn is not an exit…
Zarif Rahman
  • 79
  • 1
  • 8
0
votes
0 answers

Printing something from a text file in eBPF

I would like to load some text from a file and print it out using eBPF. Is such a thing even possible? I did something similar using bpf_probe_read but I'm wondering if there is a simpler way of doing something like this by just giving it a…
Zarif Rahman
  • 79
  • 1
  • 8
0
votes
0 answers

Trying to load xdp on nic (offloaded)

I am trying to load my XDP program directly on the NIC (offloaded XDP). According to this answer, I need to specify the device to the following functions: BPF() load_func() I did it like so: b = BPF(src_file=”file.c”, cflags=[”-w”],…
Lidorelias3
  • 27
  • 1
  • 10
0
votes
1 answer

How can I use the enum tcp mib definitions in a kprobe program?

Here, I tried to write a program(kprobe) to include the enum tcp mib like @tcp_states in the book BPF Performance Tools bpftrace. The enum tcp mib is in '/include/uapi/linux/snmp.h': #!/usr/local/bin/bpftrace #include #include…
0
votes
1 answer

kprobe of tcp_retransmit_skb. instead of tcp_retransmit_skb @tcp_states, I want to kprobe __napi_schedule

In the book BPF Performance Tools there is a implementation of kprobe of tcp_retransmit_skb. I want to do the same thing but instead of tcp_retransmit_skb @tcp_states, I want to kprobe _napi_schedule and incompocate the enum NAPI_STATE* of…
0
votes
1 answer

How to load symbol files to BCC profiler

With bcc tools' profile, I am getting mostly "[unknown]" in the profile output on my C program. This is, of course, expected because the program symbol are not loaded. However, I am not sure how to properly load the symbols so that "profile" program…
hc6
  • 153
  • 9
0
votes
0 answers

Failed to run bcc-tools profiler

I am attempting to run the bcc tool's "profile.py", and ran into the following error: ./bcc/tools/profile.py Sampling at 49 Hertz of all threads by user + kernel stack... Hit Ctrl-C to end. In file included from…
hc6
  • 153
  • 9
0
votes
1 answer

Incompatible pointer to integer conversion assigning to 'u32' (aka 'unsigned int') from 'struct net *'

What I want: To add a network namespace option to execsnoop bcc tool to trace only the logs with specified network namespace just like we have filter PID option in many other bcc tools. For eg: execsnoop -N "ns_id" I am using linux kernel structures…
user248396
  • 25
  • 4
0
votes
1 answer

Incomplete definition and forward declaration of type 'struct mnt_namespace' using BPF tools?

What I want: To add a network namespace option to execsnoop bcc tool to trace only the logs with specified network namespace just like we have filter PID option in many other bcc tools. For eg: execsnoop -N "ns_id" What I tried: int…
user248396
  • 25
  • 4
0
votes
1 answer

process name (comm) as key for BPF map

I've been trying to design a tool wherein I can do per-process tracing, but this implies that I need a key for each process so that I can store key-value map pairings for each process. I instinctually don't like using structs or strings as keys, and…
byrnesj1
  • 189
  • 1
  • 14
1 2 3
8 9