Changeset a6302ae in mainline for uspace/lib/c/generic/stats.c


Ignore:
Timestamp:
2019-12-11T10:49:48Z (4 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fe7bcf1
Parents:
ad211c8
Message:

add basic support for IPC statistics

Dumping of phone connections is supported right now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/stats.c

    rad211c8 ra6302ae  
    184184}
    185185
     186/** Get IPC connections statistics.
     187 *
     188 * @param count Number of records returned.
     189 *
     190 * @return Array of stats_ipcc_t structures.
     191 *         If non-NULL then it should be eventually freed
     192 *         by free().
     193 *
     194 */
     195stats_ipcc_t *stats_get_ipccs(size_t *count)
     196{
     197        size_t size = 0;
     198        stats_ipcc_t *stats_ipccs =
     199            (stats_ipcc_t *) sysinfo_get_data("system.ipccs", &size);
     200
     201        if ((size % sizeof(stats_ipcc_t)) != 0) {
     202                if (stats_ipccs != NULL)
     203                        free(stats_ipccs);
     204                *count = 0;
     205                return NULL;
     206        }
     207
     208        *count = size / sizeof(stats_ipcc_t);
     209        return stats_ipccs;
     210}
     211
    186212/** Get exception statistics.
    187213 *
Note: See TracChangeset for help on using the changeset viewer.