Page 1 of 1
Merging Profiler and Method Trace Functions
Posted: Fri Aug 07, 2009 1:03 pm
by ConvertFromOldNGs
by Alan >> Sun, 12 Nov 2006 20:22:38 GMT
Has anyone come across a way of programmatically starting / stopping the method trace function - directing the output to a designated file?
Re: Merging Profiler and Method Trace Functions
Posted: Fri Aug 07, 2009 1:04 pm
by ConvertFromOldNGs
by Anonymous >> Sun, 12 Nov 2006 20:47:34 GMT
No, but would be very interested to hear if this can be done.
I've tried to use the trace function a few times recently, and given up because the output contained large amounts of information I wan't interested in (mainly timer and other events). If there is a programmatic interface, perhaps output can be restricted to that of the current thread?
cheers,
Robert
Re: Merging Profiler and Method Trace Functions
Posted: Fri Aug 07, 2009 1:04 pm
by ConvertFromOldNGs
by Anonymous >> Mon, 13 Nov 2006 0:34:28 GMT
The following from an old Jade support contact:
I should also point out, that while this is an undocumented feature, it is also unsupported and may function differently under future releases of Jade. Define an external function in jlnintp as:
interpreterSendMessage(processOid : Integer; message : Integer) : Integer is interpProcessSendMessage in jlnintp applicationServerExecution;
The following code constructs an external (C++) DskObjectId structure for the current process:
vars
oid : Binary[14];
oidStr : String;
i : Integer;
classId, instId : Integer;begin
oidStr := process.getOidString;
i := 1;
classId := oidStr.scanWhile("1234567890", i).Integer;
i := i + 1;
instId := oidStr.scanWhile("1234567890", i).Integer;
oid[14:1] := null;
oid[1:2] := classId.Binary[1:2];
oid[3:4] := instId.Binary[1:4];
Use the above code fragment to construct an oid for a process, and enable method trace by calling the external function:
call interpreterSendMessage(oid.bufferAddress(), 2);
Disable method trace by calling the external again:
call interpreterSendMessage(oid.bufferAddress(), 3);
Re: Merging Profiler and Method Trace Functions
Posted: Fri Aug 07, 2009 1:04 pm
by ConvertFromOldNGs
by Anonymous >> Mon, 13 Nov 2006 1:05:07 GMT
or for the minimalist ...
vars
oid : Binary[14];begin
oid := Process.number.Binary[1:2] & getInstanceIdForObject(process).Integer.Binary[1:4];
call interpreterSendMessage(oid.bufferAddress(), 2);
Re: Merging Profiler and Method Trace Functions
Posted: Fri Aug 07, 2009 1:04 pm
by ConvertFromOldNGs
by Alan >> Mon, 13 Nov 2006 9:19:45 GMT
Thanks for that, however getting the following error on jommsg.log (and no trace)
"2006/11/13 20:12:56.359 00290-1618 Interpreter: processSendMessage: invalid process [0.2583953408.3]"
Any ideas?
Re: Merging Profiler and Method Trace Functions
Posted: Fri Aug 07, 2009 1:04 pm
by ConvertFromOldNGs
by cnwjhp1 >> Mon, 13 Nov 2006 20:26:59 GMT
Mine seems to work - see attached .scm file.
Sample usage:
process.traceMethodsOfExecution(true);
myMethod();
process.traceMethodsOfExecution(false);
Re: Merging Profiler and Method Trace Functions
Posted: Fri Aug 07, 2009 1:04 pm
by ConvertFromOldNGs
by cnwjhp1 >> Mon, 13 Nov 2006 20:28:00 GMT
Forgot to mention - use the Advanced button to load into your schema.
Re: Merging Profiler and Method Trace Functions
Posted: Fri Aug 07, 2009 1:04 pm
by ConvertFromOldNGs
by Alan >> Tue, 14 Nov 2006 10:04:13 GMT
Thanks for the schema - worked correctly.
Will need to work out how to direct the output view contents to a specific (dynamically allocated file). Haven't tried this before - I assume I will be able to achieve this via the JadeInterpreterOutputViewer settings in the INI file, however these values are retrieved when the viewer is opened, so ... will have to file a way of shutting the current viewer down - if it exists - first.