Guest User

Untitled

a guest
Apr 15th, 2016
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. #! /usr/bin/env stap
  2.  
  3. # Print a trace of threads sending IP packets (UDP or TCP) to a given
  4. # destination port and/or address. Default is unfiltered.
  5.  
  6. probe netfilter.ip.local_out {
  7. if (dport == 53)
  8. printf("%d - %s[PID %d, TID %d], GID %d, UID %d sent packet to %s:%d\n", gettimeofday_ms(), execname(), pid(), tid(), gid(), uid(), daddr, dport);
  9. printf("%.*M", buf_len, buffer_base);
  10. }
  11.  
  12.  
  13.  
  14. gave this result;
  15.  
  16.  
  17.  
  18. # stap -v who_sent_it.stp
  19. Pass 1: parsed user script and 116 library scripts using 233768virt/36872res/7284shr/29456data kb, in 150usr/30sys/185real ms.
  20. WARNING: never-assigned local variable 'buf_len' (similar: fin, syn, nf_stolen, pf, ack): identifier 'buf_len' at who_sent_it.stp:9:18
  21. source: printf("%.*M", buf_len, buffer_base);
  22. ^
  23. WARNING: never-assigned local variable 'buffer_base' (similar: ack, outdev_name, psh, rst, indev_name): identifier 'buffer_base' at :9:27
  24. source: printf("%.*M", buf_len, buffer_base);
  25. ^
  26. WARNING: never-assigned local variable 'buf_len' (similar: fin, syn, nf_stolen, pf, ack): identifier 'buf_len' at :9:18
  27. source: printf("%.*M", buf_len, buffer_base);
  28. ^
  29. WARNING: never-assigned local variable 'buffer_base' (similar: ack, outdev_name, psh, rst, indev_name): identifier 'buffer_base' at :9:27
  30. source: printf("%.*M", buf_len, buffer_base);
  31. ^
  32. Pass 2: analyzed script: 5 probes, 21 functions, 9 embeds, 3 globals using 242884virt/48140res/11780shr/36476data kb, in 460usr/2260sys/2738real ms.
  33. Missing separate debuginfos, use: debuginfo-install kernel-core-4.4.6-301.fc23.x86_64
  34. Pass 3: translated to C into "/tmp/stapJrRfBf/stap_f361a3bafe1d8e172bb7796474795a39_28715_src.c" using 242884virt/48140res/11780shr/36476data kb, in 10usr/0sys/8real ms.
  35. Pass 4: compiled C into "stap_f361a3bafe1d8e172bb7796474795a39_28715.ko" in 3320usr/750sys/3886real ms.
  36. Pass 5: starting run.
  37. ERROR: read fault [man error::fault] at 0x (null) ((((unsigned char *)(ptr)))) near identifier 'buf_len' at who_sent_it.stp:9:18
  38. WARNING: Number of errors: 1, skipped probes: 0
  39. WARNING: /usr/bin/staprun exited with status: 1
  40. Pass 5: run completed in 0usr/30sys/1059real ms.
  41. Pass 5: run failed. [man error::pass5]
Advertisement
Add Comment
Please, Sign In to add comment