-
Notifications
You must be signed in to change notification settings - Fork 4
Comparing traces #41
Comments
No, not at the moment, but I've thought about implementing map(function,
Trace1, Trace2). For your use case, you can perhaps check out and adapt the
definition of compare-past-trace.
…On Wednesday, August 23, 2017, Michael Krabbe Borregaard < ***@***.***> wrote:
Is there any capability for comparing traces? Say if you run a function
with different arguments and somewhere in the call chain it dispatches
differently, you can compare the call chains. (Maybe this is really
specific to my use, where I have a single function that does a lot of
different things).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#41>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIOSuC5I0UA7HGaMfcCxlrsphVW5-peLks5sbHiigaJpZM4PAc_E>
.
|
Nice, I'll check out compare-past-trace. Looking forward to see if you can get |
Hmmm, that should probably be an error for
Can you be more specific, or provide an example? |
Like: module Test
foo(x) = 2bar(x)
function bar(x)
if x>2
baz(x)
else
qux(x)
end
end
baz(x) = 3
qux(x) = 4
export foo
end
using TraceCalls
a = @trace Test foo(1)
b = @trace Test foo(3) I was going to plot the graphs but it seems like the above code does not work unless |
The module needs to be in a file that's in the LOAD_PATH. I just improved the error message, thank you for the report. You can also use module Test
using TraceCalls
@traceable foo(x) = 2bar(x)
@traceable function bar(x)
if x>2
baz(x)
else
qux(x)
end
end
@traceable baz(x) = 3
@traceable qux(x) = 4
export foo
end
using TraceCalls, Test
a = @trace foo(1)
b = @trace foo(3)
That could be useful, but we need to think about the semantics of Maybe it would be easier to write |
Maybe, yes. In my graphs so far, I've opted to make calls to the same function from different parts of the code separate vertices in the graph. I wanted to do it the other way first (align all sqrts), but that seems to work only great for call graphs (the non-directed ones) but become incredibly noisy for call trees (showing the order of calls). Thanks for the heads up on |
Is there any capability for comparing traces? Say if you run a function with different arguments and somewhere in the call chain it dispatches differently, you can compare the call chains. (Maybe this is really specific to my use, where I have a single function that does a lot of different things).
The text was updated successfully, but these errors were encountered: