This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
New probe alias for accepting stdin input
- From: Aaron Merey <amerey at redhat dot com>
- To: systemtap at sourceware dot org
- Date: Mon, 26 Jun 2017 12:04:10 -0400 (EDT)
- Subject: New probe alias for accepting stdin input
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=amerey at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 80BC961BBB
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 80BC961BBB
Hello all,
A new probe alias, input.char, has recently been added to Systemtap.
This alias makes data from stdin available during the runtime of
the kernel module.
The probe handler is triggered each time a character is read from stdin.
The current character can be accessed in the string variable '$value'.
Characters are read from stdin one by one as soon as they are available.
If stdin is connected to a terminal and input.char is found in the script,
Systemtap will put the terminal into non-canonical mode for the duration
of the probing. Therefore there is no newline buffering. Additional information
can be found in the "INPUT" section of the stapprobes man page.
One possible use of input.char is dynamically modifying display parameters.
An example of this can be found in EXAMPLES/general/eventcount_interactive.stp.
This is a modified version of eventcount.stp, a script which periodically prints
counts of specified events along with their tid's. Using input.char,
eventcount_interactive.stp allows this information to be sorted according to
different parameters during the script's execution.
If anyone has any feedback to offer, I'd be happy to hear it.
Best Regards,
Aaron Merey