Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools/threadsnoop: Add -h option #5134

Merged
merged 1 commit into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tools/threadsnoop.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@

from __future__ import print_function
from bcc import BPF
import argparse

examples = """examples:
./threadsnoop # list new thread creation
"""

description = """
List new thread creation.
"""

parser = argparse.ArgumentParser(description=description,
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=examples)
args = parser.parse_args()

# load BPF program
b = BPF(text="""
Expand Down
13 changes: 13 additions & 0 deletions tools/threadsnoop_example.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,16 @@ The output shows a dockerd process creating several threads with the start
routine threadentry(), and docker-containe (truncated) and systemd-journal
also starting threads: in their cases, the function had no symbol information
available, so their addresses are printed in hex.

USAGE message:

# ./threadsnoop.py -h
usage: threadsnoop.py [-h]

List new thread creation.

options:
-h, --help show this help message and exit

examples:
./threadsnoop # list new thread creation