Changeset 38d8849 in mainline for uspace/lib/c/generic/stats.c


Ignore:
Timestamp:
2018-07-16T15:58:51Z (6 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
db51219f
Parents:
c124c985
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-14 16:53:46)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-16 15:58:51)
Message:

Privatize <thread.h>.

File:
1 edited

Legend:

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

    rc124c985 r38d8849  
    184184}
    185185
    186 /** Get single thread statistics
    187  *
    188  * @param thread_id Thread ID we are interested in.
    189  *
    190  * @return Pointer to the stats_thread_t structure.
    191  *         If non-NULL then it should be eventually freed
    192  *         by free().
    193  *
    194  */
    195 stats_thread_t *stats_get_thread(thread_id_t thread_id)
    196 {
    197         char name[SYSINFO_STATS_MAX_PATH];
    198         snprintf(name, SYSINFO_STATS_MAX_PATH, "system.threads.%" PRIu64, thread_id);
    199 
    200         size_t size = 0;
    201         stats_thread_t *stats_thread =
    202             (stats_thread_t *) sysinfo_get_data(name, &size);
    203 
    204         if (size != sizeof(stats_thread_t)) {
    205                 if (stats_thread != NULL)
    206                         free(stats_thread);
    207                 return NULL;
    208         }
    209 
    210         return stats_thread;
    211 }
    212 
    213186/** Get exception statistics.
    214187 *
Note: See TracChangeset for help on using the changeset viewer.