filter-perf-events.awk 278 B

123456789101112131415
  1. #!/usr/bin/awk -f
  2. # Filter perf script output by event type
  3. # Sample usage: awk -f ./filter-perf-events.awk -v event=stalled-cycles-frontend <perf.data.dump
  4. /^[^[:space:]]/ {
  5. match_event = match($0, event ":");
  6. }
  7. match_event {
  8. print
  9. }
  10. NF == 0 {
  11. match_event = 0
  12. }