This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: trace buffer tapset proposal


William Cohen <wcohen@redhat.com> writes:

> [...] I spent some time implementing a "trace buffer" tapset. [...]

Perhaps this sort of thing would be better as a testsuite.example than
a tapset, at least until its utility is more clear.  (Note that the
tutorial includes an exercise to construct something simlar to this.
Hm, I wonder if we should provide sample solutions to the exercises!)

By the way, in the example usage, this:
 
  if (cmd_len >= 0) s = s . sprintf (" %02x", $cmd->cmnd[0]);
  if (cmd_len >= 1) s = s . sprintf (" %02x", $cmd->cmnd[1]);
  [...]
  if (cmd_len >= 14) s = s . sprintf (" %02x", $cmd->cmnd[14]);
  if (cmd_len >= 15) s = s . sprintf (" %02x", $cmd->cmnd[15]);

might be approximately abbreviated as:

  s = sprintf("%*M", cmd_len, $cmd->cmnd)

- FChE


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]