-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interpreter Stack Profiler flag #799
base: master
Are you sure you want to change the base?
Conversation
Usage: JSONNET_STACK_PROFILE=stacks.out jsonnet main.jsonnet cat stacks.out | flamegraph.pl --hash > flamegraph.svg
Rudimentary stack profiler
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
@@ -281,6 +286,15 @@ type interpreter struct { | |||
stack callStack | |||
|
|||
evalHook EvalHook | |||
|
|||
profilerOpts StackProfilerOpts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When running the govet
linter, I am seeing the following issue:
interpreter.go:267:18: fieldalignment: struct with 128 pointer bytes could be 104 (govet)
type interpreter struct {
This is a continuation of #529
I have attempted to finish what was started by @igorwwwwwwwwwwwwwwwwwwww .
To not use global variable, I added the field
profilerOpts
to the VM and interpreter objects.The
StackProfilerOpts
object stores what was the global variables.As part of adding the field, I simplified the function calls of
evaluate
,evaluateStream
, andevaluateMulti
to just take the VM object instead of individual parameters.I am unsure if it is the right type, or if it should be a
*StackProfilerOpts
instead.Thanks!