Skip to content

Commit

Permalink
define a profile_file in cfgmgr
Browse files Browse the repository at this point in the history
Signed-off-by: MarkAckert <[email protected]>
  • Loading branch information
MarkAckert committed Jan 13, 2025
1 parent 07d1086 commit 3277a9e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion c/embeddedjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ struct EmbeddedJS_tag {
int traceLevel;
};

#ifdef CONFIG_PROFILE_CALLS
FILE *profile_file = fopen("profile_data.json", "w");
#endif

struct JSValueBox_tag {
JSValue value;
};
Expand Down Expand Up @@ -2117,7 +2121,7 @@ bool configureEmbeddedJS(EmbeddedJS *embeddedJS,

#ifdef CONFIG_PROFILE_CALLS
/* profiling */
embeddedJS->profile_file = fopen("profile_data.json", "w");
embeddedJS->profile_file = profile_file;
embeddedJS->profile_sampling = 1;
JS_EnableProfileCalls(embeddedJS->rt, profile_function_start, profile_function_end, embeddedJS->profile_sampling, embeddedJS->profile_file);
fprintf(profile_file, "{\"traceEvents\": [")
Expand Down

0 comments on commit 3277a9e

Please sign in to comment.