source: mainline/uspace/app/top/top.h@ 3193c05

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 3193c05 was b3b7e14a, checked in by Martin Decky <martin@…>, 15 years ago

distinguish between "hot" and "cold" exceptions
display only "hot" exceptions by default
add top to help

  • Property mode set to 100644
File size: 2.7 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 do { \
43 if ((b) != 0) { \
44 (float).upper = (a); \
45 (float).lower = (b); \
46 } else { \
47 (float).upper = 0; \
48 (float).lower = 1; \
49 } \
50 } while (0)
51
52typedef enum {
53 OP_TASKS,
54 OP_IPC,
55 OP_EXCS,
56 OP_HELP
57} op_mode_t;
58
59extern op_mode_t op_mode;
60extern bool excs_all;
61
62typedef struct {
63 uint64_t upper;
64 uint64_t lower;
65} fixed_float;
66
67typedef struct {
68 fixed_float idle;
69 fixed_float busy;
70} perc_cpu_t;
71
72typedef struct {
73 fixed_float virtmem;
74 fixed_float ucycles;
75 fixed_float kcycles;
76} perc_task_t;
77
78typedef struct {
79 fixed_float cycles;
80 fixed_float count;
81} perc_exc_t;
82
83typedef struct {
84 time_t hours;
85 time_t minutes;
86 time_t seconds;
87
88 sysarg_t udays;
89 sysarg_t uhours;
90 sysarg_t uminutes;
91 sysarg_t useconds;
92
93 size_t load_count;
94 load_t *load;
95
96 size_t cpus_count;
97 stats_cpu_t *cpus;
98 perc_cpu_t *cpus_perc;
99
100 size_t tasks_count;
101 stats_task_t *tasks;
102 perc_task_t *tasks_perc;
103
104 size_t threads_count;
105 stats_thread_t *threads;
106
107 size_t exceptions_count;
108 stats_exc_t *exceptions;
109 perc_exc_t *exceptions_perc;
110
111 stats_physmem_t *physmem;
112} data_t;
113
114#endif
115
116/**
117 * @}
118 */
Note: See TracBrowser for help on using the repository browser.