Test PR – ThpPlugin (do not merge)#133
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Hi everyone, I am testing Cursor and figured it would be cool to make it create a new plugin and create a PR. Looks like it's done :) I don't want it to get merged though as the functionality of the plugin does not make too much sense. Don't delete the PR yet either. Thanks and sorry for messing up with you repo ;) |
Co-authored-by: Cursor <cursoragent@cursor.com>
alexandraBara
left a comment
There was a problem hiding this comment.
Keep in mind that any new files added to the repo in the year of 2026 need to have the copyright at top of the file with the correct year. So 2025->2026 for new files.
| exp_enabled: Optional[str] = None # 'always', 'madvise', 'never' | ||
| exp_defrag: Optional[str] = None |
There was a problem hiding this comment.
this is a good start. We have discussed a plugin like this internally. We concluded that this plugin, ThpPlugin (which i think we can rename to something more generic like SysfsSettingsPugin ) should accommodate analyzer_args like these (example of plugin_config.json):
{
"plugins": {
"SysfsPlugin": {
"analysis_args": {
"checks": [
{
"path": "/sys/kernel/mm/transparent_hugepage/enabled",
"expected": ["always", "[always]"],
"name": "THP enabled"
},
{
"path": "/sys/kernel/mm/transparent_hugepage/defrag",
"expected": ["always", "[always]"],
"name": "THP defrag"
}
]
}
}
}
}
notice that it allows for a list of paths, so not just "= "/sys/kernel/mm/transparent_hugepage"" -in the future we will need to check a lot more than just this setting. We also want to allow for the user to specify which, if any expected values for that setting, hence the expected can be a list, but empty list should also be accepted (for cases where we dont care what expected is, just that the path is there)
| THP_BASE = "/sys/kernel/mm/transparent_hugepage" | ||
| # Sysfs format: "[always] madvise never" -> extract bracketed value | ||
| BRACKETED_RE = re.compile(r"\[(\w+)\]") |
There was a problem hiding this comment.
the cmd that is being run here should be:
CMD = "sys/{}" where the "{}" would be a compiled list of paths taken from the analyzer arg. Defining it with a variable like CMD or CMD_<> allows our automated doc generator to pick up this cmd and include it in the docs.
i turned it into a draft until its in better shape for review |
This pull request is not supposed to get merged — it's just a test.
Made with Cursor