drivers/platform/x86/intel/telemetry/debugfs.c
Source file repositories/reference/linux-study-clean/drivers/platform/x86/intel/telemetry/debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/x86/intel/telemetry/debugfs.c- Extension
.c- Size
- 27474 bytes
- Lines
- 962
- Domain
- Driver Families
- Bucket
- drivers/platform
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/debugfs.hlinux/device.hlinux/mfd/intel_pmc_bxt.hlinux/module.hlinux/pci.hlinux/seq_file.hlinux/suspend.hasm/cpu_device_id.hasm/intel-family.hasm/intel_telemetry.h
Detected Declarations
struct telemetry_susp_statsstruct telem_pss_idle_stateinfostruct telem_pcs_blkd_infostruct telem_pss_ltr_infostruct telem_pss_wakeup_infostruct telem_ioss_d0ix_stateinfostruct telem_ioss_pg_infostruct telemetry_debugfs_conffunction Copyrightfunction telemetry_debugfs_check_evtsfunction telem_pss_states_showfunction telem_ioss_states_showfunction telem_soc_states_showfunction for_each_pci_devfunction telem_s0ix_res_getfunction telem_pss_trc_verb_showfunction telem_pss_trc_verb_writefunction telem_pss_trc_verb_openfunction telem_ioss_trc_verb_showfunction telem_ioss_trc_verb_writefunction telem_ioss_trc_verb_openfunction pm_suspend_prep_cbfunction pm_suspend_exit_cbfunction pm_notificationfunction telemetry_debugfs_initfunction telemetry_debugfs_exit
Annotated Snippet
static const struct file_operations telem_pss_trc_verb_ops = {
.open = telem_pss_trc_verb_open,
.read = seq_read,
.write = telem_pss_trc_verb_write,
.llseek = seq_lseek,
.release = single_release,
};
static int telem_ioss_trc_verb_show(struct seq_file *s, void *unused)
{
u32 verbosity;
int err;
err = telemetry_get_trace_verbosity(TELEM_IOSS, &verbosity);
if (err) {
pr_err("Get IOSS Trace Verbosity Failed with Error %d\n", err);
return -EFAULT;
}
seq_printf(s, "IOSS Trace Verbosity %u\n", verbosity);
return 0;
}
static ssize_t telem_ioss_trc_verb_write(struct file *file,
const char __user *userbuf,
size_t count, loff_t *ppos)
{
u32 verbosity;
int err;
err = kstrtou32_from_user(userbuf, count, 0, &verbosity);
if (err)
return err;
err = telemetry_set_trace_verbosity(TELEM_IOSS, verbosity);
if (err) {
pr_err("Changing IOSS Trace Verbosity Failed. Error %d\n", err);
return err;
}
return count;
}
static int telem_ioss_trc_verb_open(struct inode *inode, struct file *file)
{
return single_open(file, telem_ioss_trc_verb_show, inode->i_private);
}
static const struct file_operations telem_ioss_trc_verb_ops = {
.open = telem_ioss_trc_verb_open,
.read = seq_read,
.write = telem_ioss_trc_verb_write,
.llseek = seq_lseek,
.release = single_release,
};
static int pm_suspend_prep_cb(void)
{
struct telemetry_evtlog evtlog[TELEM_MAX_OS_ALLOCATED_EVENTS];
struct telemetry_debugfs_conf *conf = debugfs_conf;
int ret, index;
ret = telemetry_raw_read_eventlog(TELEM_IOSS, evtlog,
TELEM_MAX_OS_ALLOCATED_EVENTS);
if (ret < 0) {
suspend_prep_ok = 0;
goto out;
}
for (index = 0; index < ret; index++) {
TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_shlw_occ_id,
suspend_shlw_ctr_temp);
TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_deep_occ_id,
suspend_deep_ctr_temp);
TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_shlw_res_id,
suspend_shlw_res_temp);
TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_deep_res_id,
suspend_deep_res_temp);
}
suspend_prep_ok = 1;
out:
return NOTIFY_OK;
}
static int pm_suspend_exit_cb(void)
{
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/device.h`, `linux/mfd/intel_pmc_bxt.h`, `linux/module.h`, `linux/pci.h`, `linux/seq_file.h`, `linux/suspend.h`, `asm/cpu_device_id.h`.
- Detected declarations: `struct telemetry_susp_stats`, `struct telem_pss_idle_stateinfo`, `struct telem_pcs_blkd_info`, `struct telem_pss_ltr_info`, `struct telem_pss_wakeup_info`, `struct telem_ioss_d0ix_stateinfo`, `struct telem_ioss_pg_info`, `struct telemetry_debugfs_conf`, `function Copyright`, `function telemetry_debugfs_check_evts`.
- Atlas domain: Driver Families / drivers/platform.
- Implementation status: pattern implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.