mirror of https://github.com/torvalds/linux.git
PM: EM: Expose the ID of a performance domain via debugfs
For ease of debugging, let's expose the assigned ID of a performance domain through debugfs (e.g., /sys/kernel/debug/energy_model/cpu0/id). Signed-off-by: Changwoo Min <changwoo@igalia.com> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Link: https://patch.msgid.link/20251020220914.320832-3-changwoo@igalia.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
cbe5aeedec
commit
ee50b8bb6b
|
|
@ -126,6 +126,16 @@ static int em_debug_flags_show(struct seq_file *s, void *unused)
|
||||||
}
|
}
|
||||||
DEFINE_SHOW_ATTRIBUTE(em_debug_flags);
|
DEFINE_SHOW_ATTRIBUTE(em_debug_flags);
|
||||||
|
|
||||||
|
static int em_debug_id_show(struct seq_file *s, void *unused)
|
||||||
|
{
|
||||||
|
struct em_perf_domain *pd = s->private;
|
||||||
|
|
||||||
|
seq_printf(s, "%d\n", pd->id);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
DEFINE_SHOW_ATTRIBUTE(em_debug_id);
|
||||||
|
|
||||||
static void em_debug_create_pd(struct device *dev)
|
static void em_debug_create_pd(struct device *dev)
|
||||||
{
|
{
|
||||||
struct em_dbg_info *em_dbg;
|
struct em_dbg_info *em_dbg;
|
||||||
|
|
@ -142,6 +152,8 @@ static void em_debug_create_pd(struct device *dev)
|
||||||
debugfs_create_file("flags", 0444, d, dev->em_pd,
|
debugfs_create_file("flags", 0444, d, dev->em_pd,
|
||||||
&em_debug_flags_fops);
|
&em_debug_flags_fops);
|
||||||
|
|
||||||
|
debugfs_create_file("id", 0444, d, dev->em_pd, &em_debug_id_fops);
|
||||||
|
|
||||||
em_dbg = devm_kcalloc(dev, dev->em_pd->nr_perf_states,
|
em_dbg = devm_kcalloc(dev, dev->em_pd->nr_perf_states,
|
||||||
sizeof(*em_dbg), GFP_KERNEL);
|
sizeof(*em_dbg), GFP_KERNEL);
|
||||||
if (!em_dbg)
|
if (!em_dbg)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue