1

I'm running Arch linux on LTS kernel (4.19.75). I've checked with more recent kernels, same issue.

I do have debugfs mounted, and as root I can see this file :

/sys/kernel/debug/tracing/kprobe_events

I try to fix/run/fork (name it as you like, original code is here https://github.com/evilsocket/opensnitch) a Go program that accesses it. Here's what it does :

const (
      systemProbesFile  = "/sys/kernel/debug/tracing/kprobe_events" 
)

func writeFile(filename string, data string) error {    return ioutil.WriteFile(filename, []byte(data), 0755) }

// create the custom kprobe consumer
if err = writeFile(systemProbesFile, p.descriptor); err != nil {
    return fmt.Errorf("Error while enabling probe descriptor for %s: %s", p.name, err)
}

It gives me this error (running as root)

write /sys/kernel/debug/tracing/kprobe_events: no such file or directory

I also cannot write to it using basic shell commands (as root). The 'no such file' is weird since the file is there.

I can't find many informations regarding these special files, I ended up reading this : https://www.kernel.org/doc/html/latest/trace/kprobetrace.html ... I didn't find any reason why I could not access the file. Be it by simple "echo" or by programs.

No idea what could be missing / blocking me on my system.

I'm running with UEFI boot, and secure boot is disabled (seen somewhere that it could matter), I'm totally clueless.

thanks to anyone wih an idea as to where to look.

kind regards

squalou
  • 199
  • 1
  • 5
  • [so] is for programming questions, not questions about using or configuring Unix and its utilities. [unix.se] or [su] would be better places for questions like this. – Barmar Jan 07 '20 at 10:08
  • That's were I'm stuck in the middle of several worlds :) I'm trying to make a program work, and ... I should probably rephrase the uastion including the problematic code snippet. I don't know if it's system-configuration relate or a programmation issue. Maybe I should post two different questions on different places. – squalou Jan 07 '20 at 11:05
  • can you put an example of you ebpf program ? – Chen Keinan Mar 18 '21 at 05:15

0 Answers0