Skip to content

Conversation

@parth-07
Copy link
Contributor

@parth-07 parth-07 commented Nov 13, 2025

This commit adds primitive support for plugin activity log file functionality.
It adds the option '--plugin-activity-log ' to the linker. With this option,
the linker emits a JSON plugin activity log file that contains the
ordered records of relevent plugin actions for later analysis and debugging. Currently,
only the following operations are fully supported: RemoveSymbol, UpdateChunks,
and updateLinkStat. The support for remaining operations will be added
in follow-up patches.

One key difference between the plugin operation information in the map-file
and the plugin activity log file is that in the map-file, the plugin
operations are separated as per operation type and the plugin. On the
other hand, in the plugin activity log file, we have a single array of
the operations by all the plugins. This allows to determine the total
ordering of the operations that can be important for various analysis.

Copy link
Contributor

@quic-seaswara quic-seaswara left a comment

Choose a reason for hiding this comment

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

This is going in the right direction.

It would be useful to combine just not the activity of adding and removing chunks, we might need linker state records and also the various operations it tries to invoke via the LinkerWrapper.

Can we also generate one file per plugin ?

@partaror partaror force-pushed the PrimitivePluginActLog branch from a088a55 to bcff6f5 Compare November 24, 2025 08:56
@parth-07 parth-07 force-pushed the PrimitivePluginActLog branch from bcff6f5 to dd570ce Compare November 25, 2025 18:34
@parth-07
Copy link
Contributor Author

It would be useful to combine just not the activity of adding and removing chunks, we might need linker state records and also the various operations it tries to invoke via the LinkerWrapper.

Yes, totally agreed. This PR only adds the primitive framework for recording and printing the JSON file. Follow-up patches will extend the support for more relevant plugin operations.

Can we also generate one file per plugin ?

I do not think we should generate plugin actions per plugin as we plan to add a utility tool that users can use to filter plugin activities of a particular plugin. Please let me know your thoughts on this.

@parth-07 parth-07 force-pushed the PrimitivePluginActLog branch from dd570ce to d79d8c7 Compare November 25, 2025 18:39
@partaror partaror marked this pull request as ready for review November 25, 2025 18:41
Copy link
Contributor

@quic-seaswara quic-seaswara left a comment

Choose a reason for hiding this comment

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

As usual, pls document :)

A script to read the JSON log file will be useful.

Group<grp_mapopts>;

defm PluginActivityFile
: smDashWithOpt<"plugin-activity-file", "PluginActivityFile",
Copy link
Contributor

Choose a reason for hiding this comment

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

plugin-activity-log ? can we create a seperate category for plugins ? This is housed under map file options or diagnostics, can it be moved ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for mentioning this. Yes, I will move it to a different category. I will need to see which category would fit best for it.

I previously used the name --plugin-activity-log but later changed it to --plugin-activity-file as the latter makes it clear that the input argument would be a filename. What do you think about it?

@parth-07
Copy link
Contributor Author

As usual, pls document :)

Can we please document this once the functionality is close to complete? This PR only adds primitive support of this feature.

@parth-07 parth-07 force-pushed the PrimitivePluginActLog branch 3 times, most recently from 3c950f7 to 193d0c9 Compare December 1, 2025 15:52
PLUGIN_ACT-DAG: "Annotation": "",
PLUGIN_ACT-DAG: "Fragment": "{{.*}}1.o(.text.foo2)",
PLUGIN_ACT-DAG: "Plugin": "OutSectIterPluginActLog",
PLUGIN_ACT-DAG: "Rule": "*(.text.foo*) #Rule 1, {{.*}}script.t",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have the Rule that contains only rule strings ?

Since it is a data structure now compared to text, probably adding

RuleID :
InputFile:

This commit adds primitive support for plugin activity log file functionality.
It adds the option '--plugin-activity-log <file>' to the linker. With this option,
the linker emits a JSON plugin activity log file that contains the
ordered records of relevent plugin actions for later analysis and debugging. Currently,
only the following operations are fully supported: RemoveSymbol, UpdateChunks,
and updateLinkStat. The support for remaining operations will be added
in follow-up patches.

One key difference between the plugin operation information in the map-file
and the plugin activity log file is that in the map-file, the plugin
operations are separated as per operation type and the plugin. On the
other hand, in the plugin activity log file, we have a single array of
the operations by all the plugins. This allows to determine the total
ordering of the operations that can be important for various analysis.

Signed-off-by: Parth Arora <partaror@qti.qualcomm.com>
@partaror partaror force-pushed the PrimitivePluginActLog branch from 193d0c9 to ddb164f Compare December 2, 2025 04:21
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