STRUCT CORESIGHT_DEVICE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

okay so bestie, this page is struct coresight_device(9) from the Kernel API Manual, and it's literally the representation of a device as used by the framework. slay. πŸ’…


✨ SYNOPSIS ✨

struct coresight_device {
    struct coresight_platform_data *pdata;
    enum coresight_dev_type type;
    union coresight_dev_subtype subtype;
    const struct coresight_ops *ops;
    struct csdev_access access;
    struct device dev;
    struct coresight_path *path;
    atomic_t mode;
    int refcnt;
    int cpu;
    bool orphan;
    bool sysfs_sink_activated;
    struct dev_ext_attribute *ea;
    struct coresight_device *def_sink;
    struct coresight_trace_id_map perf_sink_id_map;
    int nr_links;
    bool has_conns_grp;
    struct list_head feature_csdev_list;
    struct list_head config_csdev_list;
    raw_spinlock_t cscfg_csdev_lock;
    void *active_cscfg_ctxt;
 };

πŸ’– Members πŸ’–

  • pdata β€” platform data with device connections associated to this device. the whole β€œwho’s connected to who” vibe. 🫢
  • type β€” as defined by coresight_dev_type. periodt.
  • subtype β€” as defined by coresight_dev_subtype. no extra lore, that’s the sentence. ✨
  • ops β€” generic operations for this component, as defined by coresight_ops. the behavior plug-in energy. πŸ”₯
  • access β€” device i/o access abstraction for this device.
  • dev β€” the device entity associated to this component.
  • path β€” activated path pointer, and it’s only used for source device. okayyy. πŸ’…
  • mode β€” the device mode, i.e sysFS, Perf or disabled. this is actually an 'enum cs_mode' but stored in an atomic type. access is always through atomic APIs, ensuring SMP-safe synchronisation between racing from sysFS and Perf mode. a compare-and-exchange operation is done to atomically claim one mode or the other. atomic mode claiming is the main character here. πŸ‘‘
  • refcnt β€” keep track of what is in use. only access this outside of the device's spinlock when the coresight_mutex is held and mode == CS_MODE_SYSFS. otherwise it must be accessed from inside the spinlock. no cap, this caveat matters. 😭
  • cpu β€” the CPU this component is affined to (-1 for not CPU bound).
  • orphan β€” true if the component has connections that haven't been linked. sad little unlinked vibe. πŸ₯Ί
  • sysfs_sink_activated β€” by writing a 1 to the 'enable_sink' file. a sink can be activated but not yet enabled. enabling for a sink happens when a source has been selected and a path is enabled from source to that sink. a sink can also become enabled but not activated if it's used via Perf. this is highkey a whole state-machine moment. πŸŒ€
  • ea β€” device attribute for sink representation under PMU directory.
  • def_sink β€” cached reference to default sink found for this device.
  • perf_sink_id_map β€” it’s in the struct as struct coresight_trace_id_map perf_sink_id_map;, and this member list doesn’t give it a separate description, so I’m not inventing one. 🫢
  • nr_links β€” number of sysfs links created to other components from this device. these will appear in the "connections" group.
  • has_conns_grp β€” have added a "connections" group for sysfs links.
  • feature_csdev_list β€” list of complex feature programming added to the device.
  • config_csdev_list β€” list of system configurations added to the device.
  • cscfg_csdev_lock β€” protect the lists of configurations and features. πŸ”’
  • active_cscfg_ctxt β€” context information for current active system configuration.

🌈 SEE ALSO 🌈

kernel file ./include/linux/coresight.h, bestie. go hang out with these:

  • union coresight_dev_subtype(9)
  • struct coresight_platform_data(9)
  • struct csdev_access(9)
  • struct coresight_desc(9)
  • struct coresight_connection(9)
  • struct coresight_sysfs_link(9)
  • struct coresight_path(9)
  • struct coresight_ops_sink(9)
  • struct coresight_ops_link(9)
  • struct coresight_ops_source(9)
  • struct coresight_ops_helper(9)
  • struct coresight_ops_panic(9)

mwah πŸ’‹ β€” source/version ./include/linux, date October 2026, page struct coresight_device(9); that’s the footer vibe, bestie. 🫢

πŸ“¦ where this page comes from