generateEndBlock creates the END block.
()
| 596 | |
| 597 | // generateEndBlock creates the END block. |
| 598 | func (g *ScriptGenerator) generateEndBlock() string { |
| 599 | if g.config.OutputJSON { |
| 600 | return `END { |
| 601 | printf("{\"event\":\"end\",\"message\":\"Trace complete\"}\n"); |
| 602 | } |
| 603 | ` |
| 604 | } |
| 605 | return `END { |
| 606 | printf("\n────────────────────────────────────────────────────────────────────────────────────────────────────────────\n"); |
| 607 | printf("Trace complete.\n"); |
| 608 | } |
| 609 | ` |
| 610 | } |
| 611 | |
| 612 | // buildSkbIPFilterCondition creates an if-statement to filter by IP inside kfree_skb body. |
| 613 | // This is used instead of a pre-filter because we need to parse the skb to get the IPs. |