Changeset 80bfb601 in mainline for kernel/generic/include


Ignore:
Timestamp:
2010-04-18T09:57:19Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d869398
Parents:
fce3536
Message:

improve sysinfo and stats documentation (no change in functionality)

Location:
kernel/generic/include/sysinfo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/sysinfo/abi.h

    rfce3536 r80bfb601  
    3131 */
    3232/** @file
     33 * Data structures passed between kernel sysinfo and user space.
    3334 */
    3435
     
    3637#define KERN_ABI_H_
    3738
     39/** Number of load components */
    3840#define LOAD_STEPS        3
     41
     42/** Maximum task name size */
    3943#define TASK_NAME_BUFLEN  20
    4044
     45/** Statistics about a single CPU
     46 *
     47 */
    4148typedef struct {
    42         unsigned int id;
    43         uint16_t frequency_mhz;
    44         uint64_t idle_ticks;
    45         uint64_t busy_ticks;
     49        unsigned int id;         /**< CPU ID as stored by kernel */
     50        uint16_t frequency_mhz;  /**< Frequency in MHz */
     51        uint64_t idle_ticks;     /**< Number of idle kernel quanta */
     52        uint64_t busy_ticks;     /**< Number of busy kernel quanta */
    4653} stats_cpu_t;
    4754
     55/** Physical memory statistics
     56 *
     57 */
    4858typedef struct {
    49         uint64_t total;
    50         uint64_t unavail;
    51         uint64_t used;
    52         uint64_t free;
     59        uint64_t total;    /**< Total physical memory (bytes) */
     60        uint64_t unavail;  /**< Unavailable (reserved, firmware) bytes */
     61        uint64_t used;     /**< Allocated physical memory (bytes) */
     62        uint64_t free;     /**< Free physical memory (bytes) */
    5363} stats_physmem_t;
    5464
     65/** IPC statistics
     66 *
     67 * Associated with a task.
     68 *
     69 */
    5570typedef struct {
    56         uint64_t call_sent;
    57         uint64_t call_recieved;
    58         uint64_t answer_sent;
    59         uint64_t answer_recieved;
    60         uint64_t irq_notif_recieved;
    61         uint64_t forwarded;
     71        uint64_t call_sent;           /**< IPC calls sent */
     72        uint64_t call_recieved;       /**< IPC calls received */
     73        uint64_t answer_sent;         /**< IPC answers sent */
     74        uint64_t answer_recieved;     /**< IPC answers received */
     75        uint64_t irq_notif_recieved;  /**< IPC IRQ notifications */
     76        uint64_t forwarded;           /**< IPC messages forwarded */
    6277} stats_ipc_t;
    6378
     79/** Statistics about a single task
     80 *
     81 */
    6482typedef struct {
    65         char name[TASK_NAME_BUFLEN];
    66         size_t virtmem;
    67         size_t threads;
    68         uint64_t ucycles;
    69         uint64_t kcycles;
    70         stats_ipc_t ipc_info;
     83        char name[TASK_NAME_BUFLEN];  /**< Task name (in kernel) */
     84        size_t virtmem;               /**< Size of VAS (bytes) */
     85        size_t threads;               /**< Number of threads */
     86        uint64_t ucycles;             /**< Number of CPU cycles in user space */
     87        uint64_t kcycles;             /**< Number of CPU cycles in kernel */
     88        stats_ipc_t ipc_info;         /**< IPC statistics */
    7189} stats_task_t;
    7290
     91/** Load fixed-point value */
    7392typedef uint32_t load_t;
    7493
  • kernel/generic/include/sysinfo/sysinfo.h

    rfce3536 r80bfb601  
    3939#include <str.h>
    4040
     41/** Framebuffer info exported flags */
    4142extern bool fb_exported;
    4243
     44/** Item value type
     45 *
     46 */
    4347typedef enum {
    44         SYSINFO_VAL_UNDEFINED = 0,
    45         SYSINFO_VAL_VAL = 1,
    46         SYSINFO_VAL_DATA = 2,
    47         SYSINFO_VAL_FUNCTION_VAL = 3,
    48         SYSINFO_VAL_FUNCTION_DATA = 4
     48        SYSINFO_VAL_UNDEFINED = 0,     /**< Undefined value */
     49        SYSINFO_VAL_VAL = 1,           /**< Constant numeric value */
     50        SYSINFO_VAL_DATA = 2,          /**< Constant binary data */
     51        SYSINFO_VAL_FUNCTION_VAL = 3,  /**< Generated numeric value */
     52        SYSINFO_VAL_FUNCTION_DATA = 4  /**< Generated binary data */
    4953} sysinfo_item_val_type_t;
    5054
     55/** Subtree type
     56 *
     57 */
    5158typedef enum {
    52         SYSINFO_SUBTREE_NONE = 0,
    53         SYSINFO_SUBTREE_TABLE = 1,
    54         SYSINFO_SUBTREE_FUNCTION = 2
     59        SYSINFO_SUBTREE_NONE = 0,     /**< No subtree (leaf item) */
     60        SYSINFO_SUBTREE_TABLE = 1,    /**< Fixed subtree */
     61        SYSINFO_SUBTREE_FUNCTION = 2  /**< Generated subtree */
    5562} sysinfo_subtree_type_t;
    5663
    5764struct sysinfo_item;
    5865
     66/** Gerated numeric value function */
    5967typedef unative_t (*sysinfo_fn_val_t)(struct sysinfo_item *);
     68
     69/** Generated binary data function */
    6070typedef void *(*sysinfo_fn_data_t)(struct sysinfo_item *, size_t *);
    6171
     72/** Sysinfo item binary data
     73 *
     74 */
    6275typedef struct {
    63         void *data;
    64         size_t size;
     76        void *data;   /**< Data */
     77        size_t size;  /**< Size (bytes) */
    6578} sysinfo_data_t;
    6679
     80/** Sysinfo item value (union)
     81 *
     82 */
    6783typedef union {
    68         unative_t val;
    69         sysinfo_fn_val_t fn_val;
    70         sysinfo_fn_data_t fn_data;
    71         sysinfo_data_t data;
     84        unative_t val;              /**< Constant numberic value */
     85        sysinfo_fn_val_t fn_val;    /**< Generated numeric value function */
     86        sysinfo_fn_data_t fn_data;  /**< Generated binary data function */
     87        sysinfo_data_t data;        /**< Constant binary data */
    7288} sysinfo_item_val_t;
    7389
     90/** Sysinfo return holder
     91 *
     92 * This structure is generated from the constant
     93 * items or by the generating functions. Note that
     94 * the validity of the data is limited by the scope
     95 * of single sysinfo invocation guarded by sysinfo_lock.
     96 *
     97 */
    7498typedef struct {
    75         sysinfo_item_val_type_t tag;
     99        sysinfo_item_val_type_t tag;  /**< Return value type */
    76100        union {
    77                 unative_t val;
    78                 sysinfo_data_t data;
     101                unative_t val;            /**< Numberic value */
     102                sysinfo_data_t data;      /**< Binary data */
    79103        };
    80104} sysinfo_return_t;
    81105
     106/** Generated subtree function */
    82107typedef sysinfo_return_t (*sysinfo_fn_subtree_t)(const char *);
    83108
     109/** Sysinfo subtree (union)
     110 *
     111 */
    84112typedef union {
    85         struct sysinfo_item *table;
    86         sysinfo_fn_subtree_t get_data;
     113        struct sysinfo_item *table;     /**< Fixed subtree (list of subitems) */
     114        sysinfo_fn_subtree_t get_data;  /**< Generated subtree function */
    87115} sysinfo_subtree_t;
    88116
     117/** Sysinfo item
     118 *
     119 */
    89120typedef struct sysinfo_item {
    90         char *name;
     121        char *name;                           /**< Item name */
    91122       
    92         sysinfo_item_val_type_t val_type;
    93         sysinfo_item_val_t val;
     123        sysinfo_item_val_type_t val_type;     /**< Item value type */
     124        sysinfo_item_val_t val;               /**< Item value */
    94125       
    95         sysinfo_subtree_type_t subtree_type;
    96         sysinfo_subtree_t subtree;
     126        sysinfo_subtree_type_t subtree_type;  /**< Subtree type */
     127        sysinfo_subtree_t subtree;            /**< Subtree */
    97128       
    98         struct sysinfo_item *next;
     129        struct sysinfo_item *next;            /**< Sibling item */
    99130} sysinfo_item_t;
    100131
     
    114145extern void sysinfo_dump(sysinfo_item_t *);
    115146
    116 unative_t sys_sysinfo_get_tag(void *, size_t);
    117 unative_t sys_sysinfo_get_value(void *, size_t, void *);
    118 unative_t sys_sysinfo_get_data_size(void *, size_t, void *);
    119 unative_t sys_sysinfo_get_data(void *, size_t, void *, size_t);
     147extern unative_t sys_sysinfo_get_tag(void *, size_t);
     148extern unative_t sys_sysinfo_get_value(void *, size_t, void *);
     149extern unative_t sys_sysinfo_get_data_size(void *, size_t, void *);
     150extern unative_t sys_sysinfo_get_data(void *, size_t, void *, size_t);
    120151
    121152#endif
Note: See TracChangeset for help on using the changeset viewer.