Changeset 196c253 in mainline for kernel/generic/src/sysinfo/stats.c
- Timestamp:
- 2012-03-02T15:53:49Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3113d47
- Parents:
- efb8d15
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/sysinfo/stats.c
refb8d15 r196c253 83 83 * 84 84 * @param item Sysinfo item (unused). 85 * @param data Unused. 85 86 * 86 87 * @return System uptime (in secords). 87 88 * 88 89 */ 89 static sysarg_t get_stats_uptime(struct sysinfo_item *item )90 static sysarg_t get_stats_uptime(struct sysinfo_item *item, void *data) 90 91 { 91 92 /* This doesn't have to be very accurate */ … … 98 99 * @param size Size of the returned data. 99 100 * @param dry_run Do not get the data, just calculate the size. 101 * @param data Unused. 100 102 * 101 103 * @return Data containing several stats_cpu_t structures. … … 104 106 */ 105 107 static void *get_stats_cpus(struct sysinfo_item *item, size_t *size, 106 bool dry_run )108 bool dry_run, void *data) 107 109 { 108 110 *size = sizeof(stats_cpu_t) * config.cpu_count; … … 293 295 * @param size Size of the returned data. 294 296 * @param dry_run Do not get the data, just calculate the size. 297 * @param data Unused. 295 298 * 296 299 * @return Data containing several stats_task_t structures. … … 299 302 */ 300 303 static void *get_stats_tasks(struct sysinfo_item *item, size_t *size, 301 bool dry_run )304 bool dry_run, void *data) 302 305 { 303 306 /* Messing with task structures, avoid deadlock */ … … 398 401 * @param size Size of the returned data. 399 402 * @param dry_run Do not get the data, just calculate the size. 403 * @param data Unused. 400 404 * 401 405 * @return Data containing several stats_task_t structures. … … 404 408 */ 405 409 static void *get_stats_threads(struct sysinfo_item *item, size_t *size, 406 bool dry_run )410 bool dry_run, void *data) 407 411 { 408 412 /* Messing with threads structures, avoid deadlock */ … … 590 594 * @param size Size of the returned data. 591 595 * @param dry_run Do not get the data, just calculate the size. 596 * @param data Unused. 592 597 * 593 598 * @return Data containing several stats_exc_t structures. … … 596 601 */ 597 602 static void *get_stats_exceptions(struct sysinfo_item *item, size_t *size, 598 bool dry_run )603 bool dry_run, void *data) 599 604 { 600 605 *size = sizeof(stats_exc_t) * IVT_ITEMS; … … 711 716 * @param size Size of the returned data. 712 717 * @param dry_run Do not get the data, just calculate the size. 718 * @param data Unused. 713 719 * 714 720 * @return Data containing stats_physmem_t. … … 717 723 */ 718 724 static void *get_stats_physmem(struct sysinfo_item *item, size_t *size, 719 bool dry_run )725 bool dry_run, void *data) 720 726 { 721 727 *size = sizeof(stats_physmem_t); … … 741 747 * @param size Size of the returned data. 742 748 * @param dry_run Do not get the data, just calculate the size. 749 * @param data Unused. 743 750 * 744 751 * @return Data several load_t values. … … 747 754 */ 748 755 static void *get_stats_load(struct sysinfo_item *item, size_t *size, 749 bool dry_run )756 bool dry_run, void *data) 750 757 { 751 758 *size = sizeof(load_t) * LOAD_STEPS; … … 816 823 mutex_initialize(&load_lock, MUTEX_PASSIVE); 817 824 818 sysinfo_set_item_ fn_val("system.uptime", NULL, get_stats_uptime);819 sysinfo_set_item_ fn_data("system.cpus", NULL, get_stats_cpus);820 sysinfo_set_item_ fn_data("system.physmem", NULL, get_stats_physmem);821 sysinfo_set_item_ fn_data("system.load", NULL, get_stats_load);822 sysinfo_set_item_ fn_data("system.tasks", NULL, get_stats_tasks);823 sysinfo_set_item_ fn_data("system.threads", NULL, get_stats_threads);824 sysinfo_set_item_ fn_data("system.exceptions", NULL, get_stats_exceptions);825 sysinfo_set_item_gen_val("system.uptime", NULL, get_stats_uptime, NULL); 826 sysinfo_set_item_gen_data("system.cpus", NULL, get_stats_cpus, NULL); 827 sysinfo_set_item_gen_data("system.physmem", NULL, get_stats_physmem, NULL); 828 sysinfo_set_item_gen_data("system.load", NULL, get_stats_load, NULL); 829 sysinfo_set_item_gen_data("system.tasks", NULL, get_stats_tasks, NULL); 830 sysinfo_set_item_gen_data("system.threads", NULL, get_stats_threads, NULL); 831 sysinfo_set_item_gen_data("system.exceptions", NULL, get_stats_exceptions, NULL); 825 832 sysinfo_set_subtree_fn("system.tasks", NULL, get_stats_task, NULL); 826 833 sysinfo_set_subtree_fn("system.threads", NULL, get_stats_thread, NULL);
Note:
See TracChangeset
for help on using the changeset viewer.