source: mainline/uspace/app/top/top.h@ 1113c9e

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 1113c9e was dec16a2, checked in by Martin Decky <martin@…>, 16 years ago
  • sysinfo items "system.tasks" and "system.threads" now return complete statistics of all tasks and threads (statistics of individual tasks and threads can be still acquited from "system.tasks.#" and "system.threads.#")
  • update user space functions accordingly
  • cleanup top — it is fully functional again
  • Property mode set to 100644
File size: 2.4 KB
Line 
1/*
2 * Copyright (c) 2010 Stanislav Kozina
3 * Copyright (c) 2010 Martin Decky
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * - Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * - The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30/** @addtogroup top
31 * @{
32 */
33
34#ifndef TOP_TOP_H_
35#define TOP_TOP_H_
36
37#include <task.h>
38#include <stats.h>
39#include <time.h>
40
41#define FRACTION_TO_FLOAT(float, a, b) { \
42 (float).upper = (a); \
43 (float).lower = (b); \
44}
45
46#define OP_TASKS 1
47#define OP_IPC 2
48
49extern int operation_type;
50
51typedef struct {
52 uint64_t upper;
53 uint64_t lower;
54} fixed_float;
55
56typedef struct {
57 fixed_float idle;
58 fixed_float busy;
59} perc_cpu_t;
60
61typedef struct {
62 fixed_float ucycles;
63 fixed_float kcycles;
64 fixed_float virtmem;
65} perc_task_t;
66
67typedef struct {
68 time_t hours;
69 time_t minutes;
70 time_t seconds;
71
72 sysarg_t udays;
73 sysarg_t uhours;
74 sysarg_t uminutes;
75 sysarg_t useconds;
76
77 size_t load_count;
78 load_t *load;
79
80 size_t cpus_count;
81 stats_cpu_t *cpus;
82 perc_cpu_t *cpus_perc;
83
84 size_t tasks_count;
85 stats_task_t *tasks;
86 perc_task_t *tasks_perc;
87
88 size_t threads_count;
89 stats_thread_t *threads;
90
91 stats_physmem_t *physmem;
92} data_t;
93
94#endif
95
96/**
97 * @}
98 */
Note: See TracBrowser for help on using the repository browser.