Skip to content

Conversation

altimin
Copy link
Collaborator

@altimin altimin commented Sep 21, 2025

Leverage the new print_args() function to avoid reconstructing the args tree in JS.

This change doesn't affect UX, just simplifies the code.

@altimin altimin requested a review from a team as a code owner September 21, 2025 17:52
Add a helper function to print the entire set of args at once as a JSON object,
reusing existing functionality for exporting arg sets to json.

This makes it easier to inspect arg sets at a glance and would enable
simplifying the UI code by removing the logic which constructs arg tree in
javascript.
Leverage the new print_args() function to avoid reconstructing the args tree in JS.
@altimin altimin force-pushed the dev/altimin/print_args branch from 96c7193 to 0b5e8dc Compare September 21, 2025 18:01
@altimin altimin force-pushed the dev/altimin/ui_args branch from c57f6be to 36deba0 Compare September 21, 2025 18:01
@altimin altimin force-pushed the dev/altimin/print_args branch 2 times, most recently from 1f344a9 to 6d07d6e Compare September 21, 2025 19:54
Copy link
Member

@stevegolton stevegolton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks very reasonable in general in terms of the UI side.

That said (and I realize that this PR in particular doesn't change much in this regard, apart from in the ftrace event details panel) but I'm not a huge fan of the fact that the query is abstracted behind the getArgs function.

I'd like to have the option to fetch everything in one go like:

SELECT
   *,
   print_args(arg_set_id) AS argsJson
FROM foo

Then have a synchronous helper to turn this into this into a tree of ArgDict for printing and processing.

In general the SQL helper functions like this usually end up pulling duplicate data and slowing things down. I'll concede that this args example is quite clean but I think as a general principle they should be avoided.

Again as this PR doesn't really change this much (apart from in the ftrace details panel), I think we can tackle this in a different PR, but I thought I'd mention it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants