diff options
| author | Honggyu Kim <honggyu.kim@sk.com> | 2025-07-07 11:45:47 +0900 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2025-07-19 18:59:47 -0700 |
| commit | 793020545cea0c9e2a79de6ad5c9746ec4f5bd7e (patch) | |
| tree | 0de213bdfe5de168e2d89a7ac875e87dbceed74c /samples/damon/prcl.c | |
| parent | 8356a5a3b078ca89c526dd6d71e9a76fec571c37 (diff) | |
| download | lwn-793020545cea0c9e2a79de6ad5c9746ec4f5bd7e.tar.gz lwn-793020545cea0c9e2a79de6ad5c9746ec4f5bd7e.zip | |
samples/damon: change enable parameters to enabled
The damon_{lru_sort,reclaim,stat} kernel modules use "enabled" parameter
knobs as follows.
/sys/module/damon_lru_sort/parameters/enabled
/sys/module/damon_reclaim/parameters/enabled
/sys/module/damon_stat/parameters/enabled
However, other sample modules of damon use "enable" parameter knobs so
it'd be better to rename them from "enable" to "enabled" to keep the
consistency with other damon modules.
Before:
/sys/module/damon_sample_wsse/parameters/enable
/sys/module/damon_sample_prcl/parameters/enable
/sys/module/damon_sample_mtier/parameters/enable
After:
/sys/module/damon_sample_wsse/parameters/enabled
/sys/module/damon_sample_prcl/parameters/enabled
/sys/module/damon_sample_mtier/parameters/enabled
There is no functional changes in this patch.
Link: https://lkml.kernel.org/r/20250707024548.1964-1-honggyu.kim@sk.com
Signed-off-by: Honggyu Kim <honggyu.kim@sk.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'samples/damon/prcl.c')
| -rw-r--r-- | samples/damon/prcl.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/samples/damon/prcl.c b/samples/damon/prcl.c index 4b0e47718c62..8a312dba7691 100644 --- a/samples/damon/prcl.c +++ b/samples/damon/prcl.c @@ -22,14 +22,14 @@ module_param(target_pid, int, 0600); static int damon_sample_prcl_enable_store( const char *val, const struct kernel_param *kp); -static const struct kernel_param_ops enable_param_ops = { +static const struct kernel_param_ops enabled_param_ops = { .set = damon_sample_prcl_enable_store, .get = param_get_bool, }; -static bool enable __read_mostly; -module_param_cb(enable, &enable_param_ops, &enable, 0600); -MODULE_PARM_DESC(enable, "Enable of disable DAMON_SAMPLE_WSSE"); +static bool enabled __read_mostly; +module_param_cb(enabled, &enabled_param_ops, &enabled, 0600); +MODULE_PARM_DESC(enabled, "Enable or disable DAMON_SAMPLE_PRCL"); static struct damon_ctx *ctx; static struct pid *target_pidp; @@ -119,20 +119,20 @@ static bool init_called; static int damon_sample_prcl_enable_store( const char *val, const struct kernel_param *kp) { - bool enabled = enable; + bool is_enabled = enabled; int err; - err = kstrtobool(val, &enable); + err = kstrtobool(val, &enabled); if (err) return err; - if (enable == enabled) + if (enabled == is_enabled) return 0; - if (enable) { + if (enabled) { err = damon_sample_prcl_start(); if (err) - enable = false; + enabled = false; return err; } damon_sample_prcl_stop(); @@ -144,10 +144,10 @@ static int __init damon_sample_prcl_init(void) int err = 0; init_called = true; - if (enable) { + if (enabled) { err = damon_sample_prcl_start(); if (err) - enable = false; + enabled = false; } return 0; } |
