mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-30 05:42:46 +01:00
samples/damon/wsse: use damon_call() repeat mode instead of damon_callback
wsse uses damon_callback for periodically reading DAMON internal data. Use its alternative, damon_call() repeat mode. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: SeongJae Park <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
This commit is contained in:
1 parent
a6c33f1054
commit
cc9c1b8c20
1 file changed
+13
-3
+13
-3
@@ -35,8 +35,9 @@ MODULE_PARM_DESC(enabled, "Enable or disable DAMON_SAMPLE_WSSE");
|
||||
static struct damon_ctx *ctx;
|
||||
static struct pid *target_pidp;
|
||||
|
||||
static int damon_sample_wsse_after_aggregate(struct damon_ctx *c)
|
||||
static int damon_sample_wsse_repeat_call_fn(void *data)
|
||||
{
|
||||
struct damon_ctx *c = data;
|
||||
struct damon_target *t;
|
||||
|
||||
damon_for_each_target(t, c) {
|
||||
@@ -52,9 +53,15 @@ static int damon_sample_wsse_after_aggregate(struct damon_ctx *c)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct damon_call_control repeat_call_control = {
|
||||
.fn = damon_sample_wsse_repeat_call_fn,
|
||||
.repeat = true,
|
||||
};
|
||||
|
||||
static int damon_sample_wsse_start(void)
|
||||
{
|
||||
struct damon_target *target;
|
||||
int err;
|
||||
|
||||
pr_info("start\n");
|
||||
|
||||
@@ -79,8 +86,11 @@ static int damon_sample_wsse_start(void)
|
||||
}
|
||||
target->pid = target_pidp;
|
||||
|
||||
ctx->callback.after_aggregation = damon_sample_wsse_after_aggregate;
|
||||
return damon_start(&ctx, 1, true);
|
||||
err = damon_start(&ctx, 1, true);
|
||||
if (err)
|
||||
return err;
|
||||
repeat_call_control.data = ctx;
|
||||
return damon_call(ctx, &repeat_call_control);
|
||||
}
|
||||
|
||||
static void damon_sample_wsse_stop(void)
|
||||
|
||||
Reference in new issue
Block a user