diff options
author | SeongJae Park <sj@kernel.org> | 2022-06-06 18:23:06 +0000 |
---|---|---|
committer | akpm <akpm@linux-foundation.org> | 2022-07-03 18:08:38 -0700 |
commit | c9e124e0382d83d458db204f929002ea98daa6a8 (patch) | |
tree | 7c3f1f9a10a335ce423ff9706c8690968712cede /include | |
parent | 205498012513f9a1209d9335bf3766080c587a33 (diff) | |
download | lwn-c9e124e0382d83d458db204f929002ea98daa6a8.tar.gz lwn-c9e124e0382d83d458db204f929002ea98daa6a8.zip |
mm/damon/{dbgfs,sysfs}: move target_has_pid() from dbgfs to damon.h
The function for knowing if given monitoring context's targets will have
pid or not is defined and used in dbgfs only. However, the logic is also
needed for sysfs. This commit moves the code to damon.h and makes both
dbgfs and sysfs to use it.
Link: https://lkml.kernel.org/r/20220606182310.48781-3-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/damon.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/damon.h b/include/linux/damon.h index 2765c7d99beb..b9aae19fab3e 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -525,6 +525,12 @@ bool damon_is_registered_ops(enum damon_ops_id id); int damon_register_ops(struct damon_operations *ops); int damon_select_ops(struct damon_ctx *ctx, enum damon_ops_id id); +static inline bool damon_target_has_pid(const struct damon_ctx *ctx) +{ + return ctx->ops.id == DAMON_OPS_VADDR || ctx->ops.id == DAMON_OPS_FVADDR; +} + + int damon_start(struct damon_ctx **ctxs, int nr_ctxs, bool exclusive); int damon_stop(struct damon_ctx **ctxs, int nr_ctxs); |