include/rv/da_monitor.h
Source file repositories/reference/linux-study-clean/include/rv/da_monitor.h
File Facts
- System
- Linux kernel
- Corpus path
include/rv/da_monitor.h- Extension
.h- Size
- 23053 bytes
- Lines
- 912
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
rv/automata.hlinux/rv.hlinux/stringify.hlinux/bug.hlinux/sched.hlinux/slab.hlinux/hashtable.h
Detected Declarations
struct da_monitor_storagefunction constraintsfunction da_monitor_reset_statefunction da_monitor_resetfunction da_monitor_startfunction da_monitoringfunction da_monitor_enabledfunction da_monitor_handling_eventfunction __da_monitor_reset_allfunction da_monitor_reset_allfunction da_monitor_reset_state_allfunction da_monitor_initfunction da_monitor_destroyfunction __da_monitor_reset_allfunction for_each_cpufunction da_monitor_reset_allfunction da_monitor_reset_state_allfunction da_monitor_initfunction da_monitor_destroyfunction da_get_idfunction __da_monitor_reset_allfunction da_monitor_reset_allfunction da_monitor_reset_state_allfunction da_monitor_initfunction da_monitor_destroyfunction targetfunction da_get_targetfunction da_get_idfunction da_create_storagefunction da_get_target_by_idfunction da_monitor_destroyfunction __da_monitor_reset_allfunction da_monitor_reset_allfunction da_monitor_reset_state_allfunction da_monitor_initfunction da_monitor_destroyfunction allocationfunction da_trace_errorfunction da_get_idfunction da_trace_eventfunction da_trace_errorfunction da_eventfunction __da_handle_event_commonfunction __da_handle_eventfunction __da_handle_start_eventfunction __da_handle_start_run_eventfunction da_handle_eventfunction da_handle_start_event
Annotated Snippet
struct da_monitor_storage {
da_id_type id;
monitor_target target;
union rv_task_monitor rv;
struct hlist_node node;
struct rcu_head rcu;
};
#ifndef DA_MONITOR_HT_BITS
#define DA_MONITOR_HT_BITS 10
#endif
static DEFINE_HASHTABLE(da_monitor_ht, DA_MONITOR_HT_BITS);
/*
* da_create_empty_storage - pre-allocate an empty storage
*/
static inline struct da_monitor_storage *da_create_empty_storage(da_id_type id)
{
struct da_monitor_storage *mon_storage;
mon_storage = kmalloc_nolock(sizeof(struct da_monitor_storage),
__GFP_ZERO, NUMA_NO_NODE);
if (!mon_storage)
return NULL;
hash_add_rcu(da_monitor_ht, &mon_storage->node, id);
mon_storage->id = id;
return mon_storage;
}
/*
* da_create_storage - create the per-object storage
*
* The caller is responsible to synchronise writers, either with locks or
* implicitly. For instance, if da_create_storage is only called from a single
* event for target (e.g. sched_switch), it's safe to call this without locks.
*/
static inline struct da_monitor *da_create_storage(da_id_type id,
monitor_target target,
struct da_monitor *da_mon)
{
struct da_monitor_storage *mon_storage;
if (da_mon)
return da_mon;
mon_storage = da_create_empty_storage(id);
if (!mon_storage)
return NULL;
mon_storage->target = target;
return &mon_storage->rv.da_mon;
}
/*
* __da_get_mon_storage - get the monitor storage from the hash table
*/
static inline struct da_monitor_storage *__da_get_mon_storage(da_id_type id)
{
struct da_monitor_storage *mon_storage;
lockdep_assert_in_rcu_read_lock();
hash_for_each_possible_rcu(da_monitor_ht, mon_storage, node, id) {
if (mon_storage->id == id)
return mon_storage;
}
return NULL;
}
/*
* da_get_monitor - return the monitor for target
*/
static struct da_monitor *da_get_monitor(da_id_type id, monitor_target target)
{
struct da_monitor_storage *mon_storage;
mon_storage = __da_get_mon_storage(id);
return mon_storage ? &mon_storage->rv.da_mon : NULL;
}
/*
* da_get_target - return the object associated to the monitor
*/
static inline monitor_target da_get_target(struct da_monitor *da_mon)
{
return container_of(da_mon, struct da_monitor_storage, rv.da_mon)->target;
}
/*
Annotation
- Immediate include surface: `rv/automata.h`, `linux/rv.h`, `linux/stringify.h`, `linux/bug.h`, `linux/sched.h`, `linux/slab.h`, `linux/hashtable.h`.
- Detected declarations: `struct da_monitor_storage`, `function constraints`, `function da_monitor_reset_state`, `function da_monitor_reset`, `function da_monitor_start`, `function da_monitoring`, `function da_monitor_enabled`, `function da_monitor_handling_event`, `function __da_monitor_reset_all`, `function da_monitor_reset_all`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.