You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
618 B

  1. #!/usr/bin/perl
  2. die <<EEE unless @ARGV;
  3. Usage: $0 func1 [func2 [ ...] ]
  4. This filter (stdin->stdout) removes lines from dbug trace that were generated
  5. by specified functions and all functions down the call stack. Produces the
  6. same effect as if the original source had DBUG_PUSH(""); right after
  7. DBUG_ENTER() and DBUG_POP(); right before DBUG_RETURN in every such a function.
  8. EEE
  9. $re=join('|', @ARGV);
  10. $skip='';
  11. while(<STDIN>) {
  12. print unless $skip;
  13. next unless /^(?:.*: )*((?:\| )*)([<>])($re)\n/o;
  14. if ($2 eq '>') {
  15. $skip=$1.$3 unless $skip;
  16. next;
  17. }
  18. next if $skip ne $1.$3;
  19. $skip='';
  20. print;
  21. }