Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: tickcounter.h

Issue 6893111: Enhancements to ktop (Closed) Base URL: ssh://gitrw.chromium.org:9222/ktop.git@master
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « syscall.h ('k') | tickcounter.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. 2 * Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
3 * Distributed under the terms of the GNU General Public License v2 3 * Distributed under the terms of the GNU General Public License v2
4 */ 4 */
5 #ifndef _TICKCOUNTER_H 5 #ifndef _TICKCOUNTER_H_
6 #define _TICKCOUNTER_H 1 6 #define _TICKCOUNTER_H_ 1
7 7
8 enum { WHEEL_SIZE = 60 }; 8 enum { WHEEL_SIZE = 60 };
9 9
10 typedef struct Avg_s { 10 typedef struct Avg_s {
11 u32 avg; 11 u32 avg;
12 u32 peak; 12 u32 peak;
13 } Avg_s; 13 } Avg_s;
14 14
15 typedef struct TickCounter_s { 15 typedef struct TickCounter_s {
16 u32 tick_size; /* Must be factor of WHEEL_SIZE */ 16 u32 tick_size; /* Must be factor of WHEEL_SIZE */
17 u32 ticks_per_wheel; 17 u32 ticks_per_wheel;
18 u32 hour_wrapped; 18 u32 hour_wrapped;
19 u8 itick; 19 u8 itick;
20 u8 iminute; 20 u8 iminute;
21 u8 ihour; 21 u8 ihour;
22 u32 tick[WHEEL_SIZE]; 22 u32 tick[WHEEL_SIZE];
23 Avg_s minute[WHEEL_SIZE]; 23 Avg_s minute[WHEEL_SIZE];
24 Avg_s hour[WHEEL_SIZE]; 24 Avg_s hour[WHEEL_SIZE];
25 } TickCounter_s; 25 } TickCounter_s;
26 26
27 void tick(TickCounter_s *counter, u32 n); 27 void tick(TickCounter_s *counter, u32 n);
28 bool init_counter(TickCounter_s *counter, u32 tick); 28 bool init_counter(TickCounter_s *counter, u32 tick);
29 29
30 #endif 30 #endif
OLDNEW
« no previous file with comments | « syscall.h ('k') | tickcounter.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698