microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.19k stars 806 forks source link

No tracepoint events #9270

Closed CSWYF3634076 closed 1 year ago

CSWYF3634076 commented 1 year ago

Version

Microsoft Windows [版本 10.0.22000.978]

WSL Version

Kernel Version

Linux version 5.10.16.3-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Fri Apr 2 22:23:49 UTC 2021

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

The following problems occur when I use ebpf tracepoint image Then I check tracepoint event . ls /sys/kernel/debug/traceing/events image

Default CONFIG_DEBUG_INFO_BTF=n ?

Expected Behavior

ls /sys/kernel/debug/traceing/events image

Actual Behavior

ls /sys/kernel/debug/traceing/events image

Diagnostic Logs

No response

elsaco commented 1 year ago

@CSWYF3634076 what version of WSL2 are you using? That's an old kernel! With kernel 5.15.74.2 that's included in WSL2 1.0.0 both CONFIG_DEBUG_INFO=y and CONFIG_DEBUG_INFO_BTF=y are set.

Output of /sys/kernel/debug/tracing/events dir:

tux@eleven:~/foo$ sudo ls /sys/kernel/debug/tracing/events
9p            compaction    fib           hyperv       jbd2       neigh    page_isolation  rseq    swiotlb   workqueue
alarmtimer    cpuhp         fib6          i2c          kmem       net      pagemap         rtc     syscalls  writeback
block         dev           filelock      initcall     kvm        netfs    percpu          sched   task      x86_fpu
bpf_test_run  dma_fence     filemap       intel_iommu  kvmmmu     netlink  power           scsi    tcp       xdp
bpf_trace     drm           fscache       iomap        migrate    netvsc   printk          sctp    thermal   xfs
bridge        enable        fs_dax        iommu        mmap       nfs      qdisc           signal  timer     xfs_scrub
btrfs         erofs         ftrace        io_uring     mmap_lock  nfs4     ras             skb     tlb
cgroup        error_report  header_event  irq          module     nfsd     raw_syscalls    smbus   udp
cifs          exceptions    header_page   irq_matrix   msr        nmi      rcu             sock    vmscan
clk           ext4          huge_memory   irq_vectors  napi       oom      rpcgss          sunrpc  vsyscall

WSL info used for testing:

WSL version: 1.0.0.0
Kernel version: 5.15.74.2
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.900
CSWYF3634076 commented 1 year ago

@elsaco Thanks for your advice. I replaced the kernel 5.15.79.1. BTF related content is available, but the tracepoint path still has no content. The process of replacing the kernel is as follows image

cd WSL2-Linux-Kernel-linux-msft-wsl-5.15.79.1
make -j8

Move bzImage to custom directory, then modify the .wslconfig file image

Restart wsl2 and check relevant contents

image

OneBlue commented 1 year ago

@CSWYF3634076: /sys/kernel/debug/ needs to be mounted. You can do this via mount -t debugfs none /sys/kernel/debug/

Closing since this is fixed in a more recent kernel.