include/linux/profile.h
Source file repositories/reference/linux-study-clean/include/linux/profile.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/profile.h- Extension
.h- Size
- 1423 bytes
- Lines
- 85
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/init.hlinux/cache.hasm/errno.h
Detected Declarations
struct proc_dir_entrystruct notifier_blockstruct task_structstruct mm_structfunction create_proc_profilefunction profile_hitfunction profile_initfunction profile_tickfunction profile_hitsfunction profile_hit
Annotated Snippet
#ifndef _LINUX_PROFILE_H
#define _LINUX_PROFILE_H
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/cache.h>
#include <asm/errno.h>
#define CPU_PROFILING 1
#define SCHED_PROFILING 2
#define KVM_PROFILING 4
struct proc_dir_entry;
struct notifier_block;
#if defined(CONFIG_PROFILING) && defined(CONFIG_PROC_FS)
int create_proc_profile(void);
#else
static inline int create_proc_profile(void)
{
return 0;
}
#endif
#ifdef CONFIG_PROFILING
extern int prof_on __read_mostly;
/* init basic kernel profiler */
int profile_init(void);
int profile_setup(char *str);
void profile_tick(int type);
int setup_profiling_timer(unsigned int multiplier);
/*
* Add multiple profiler hits to a given address:
*/
void profile_hits(int type, void *ip, unsigned int nr_hits);
/*
* Single profiler hit:
*/
static inline void profile_hit(int type, void *ip)
{
/*
* Speedup for the common (no profiling enabled) case:
*/
if (unlikely(prof_on == type))
profile_hits(type, ip, 1);
}
struct task_struct;
struct mm_struct;
#else
#define prof_on 0
static inline int profile_init(void)
{
return 0;
}
static inline void profile_tick(int type)
{
return;
}
static inline void profile_hits(int type, void *ip, unsigned int nr_hits)
{
return;
}
static inline void profile_hit(int type, void *ip)
{
return;
}
#endif /* CONFIG_PROFILING */
#endif /* _LINUX_PROFILE_H */
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/cache.h`, `asm/errno.h`.
- Detected declarations: `struct proc_dir_entry`, `struct notifier_block`, `struct task_struct`, `struct mm_struct`, `function create_proc_profile`, `function profile_hit`, `function profile_init`, `function profile_tick`, `function profile_hits`, `function profile_hit`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source 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.