patchGNU Octave - Patches: patch #8364, Add SystemTap user space probes.

 
 

patch #8364: Add SystemTap user space probes.

Submitter:  Rüdiger Sonderfeld <ruediger>
Submitted:  Wed 26 Feb 2014 08:13:35 PM UTC
   
 
Category:  Core : new feature Priority:  3 - Low
Status:  Wont Do Privacy:  Public
Assigned to:  None Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 18 Jan 2020 12:10:37 PM UTC, comment #1: 

Review for Octave 6.

No response for almost 6 years.  The software "SystemTap" still seems to be under active development and if you are interested you can add this approach to the wiki

https://wiki.octave.org/Debugging_Octave

In general Octave can use other techniques for debugging, as described there.

Closing item.

Kai Torben Ohlhus <siko1056>
Group Member
Wed 26 Feb 2014 08:13:35 PM UTC, original submission:  

SystemTap (https://sourceware.org/systemtap/) is an advanced tracing framework for GNU/Linux.  It not only provides functionality to trace the kernel but also user space probes.  Those probes are low overhead and allow a user to query information.  They are also supported in recent versions of GDB.

This patch adds the infrastructure for user space probes to the GNU Octave source code.  Which mainly consists of a configure flag and check and a header to provide empty probe macros in case sys/sdt.h is not available.  It also adds two example probes to allow tracing the execution of user functions (enter/return).

Here is a simple SystemTap script which allows tracing user functions:

probe process("./libinterp/.libs/liboctinterp.so.2.0.0").mark("usr_fcn_enter") {
  printf("%s ⇒ %s (%s:%d:%d)\n", thread_indent(1), user_string($arg1),
         user_string($arg2), $arg3, $arg4);
}

probe process("./libinterp/.libs/liboctinterp.so.2.0.0").mark("usr_fcn_return") {
  printf("%s ⇐ %s\n", thread_indent(-1), user_string($arg1));
}

And the output for calling "help help" (executed using: stap example.stp -c "./run-octave --no-gui")

11215472 QThread(31502):   ⇒ help (:-1:-1)
11219760 QThread(31502):    ⇒ _makeinfo_ (/home/ruediger/src/octave/build/../scripts/help/help.m:99:22)
11220632 QThread(31502):     ⇒ tempdir (/home/ruediger/src/octave/build/../scripts/help/__makeinfo__.m:122:15)
11220971 QThread(31502):      ⇒ isdir (/home/ruediger/src/octave/build/../scripts/miscellaneous/tempdir.m:35:3)
11221050 QThread(31502):      ⇐ isdir
11221063 QThread(31502):     ⇐ tempdir
11221092 QThread(31502):     ⇒ fullfile (/home/ruediger/src/octave/build/../scripts/help/__makeinfo__.m:122:15)
11221294 QThread(31502):     ⇐ fullfile
11425082 QThread(31502):     ⇒ delete (/home/ruediger/src/octave/build/../scripts/help/__makeinfo__.m:146:7)
11425873 QThread(31502):     ⇐ delete
11425939 QThread(31502):    ⇐ _makeinfo_
11428946 QThread(31502):    ⇒ which (/home/ruediger/src/octave/build/../scripts/help/help.m:117:7)
11430529 QThread(31502):    ⇐ which
11431545 QThread(31502):    ⇒ _additional_help_message_ (/home/ruediger/src/octave/build/../scripts/help/help.m:118:7)
11431684 QThread(31502):    ⇐ _additional_help_message_
11431864 QThread(31502):   ⇐ help

The script could be further simplified by adding a proper tapset library.  Adding a probe to the code is straight forward:

DTRACE_PROBE2 (octave, usr_fcn_return, profiler_name ().c_str (), retval);

This adds the probe `usr_fcn_return' to the `octave' provider and passes the two arguments.

The name DTRACE_PROBE2 is used for potential DTrace compatibility.  The patch itself is not DTrace compatible because this would require small adjustments to the build process.  I don't have a DTrace compatible system available and I'm not sure if DTrace user space probes would even be license compatible.

Rüdiger Sonderfeld <ruediger>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #30715:  userprobes.patch added by ruediger (5KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by ruediger (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-01-18 siko1056 CategoryNone Core : new feature
        Priority5 - Normal 3 - Low
        StatusNone Wont Do
        Open/ClosedOpen Closed
    2014-02-26 ruediger Attached File- Added userprobes.patch, #30715

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code