chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
conf-parser: restrict .include usage
[elogind.git]
/
src
/
bootchart
/
svg.c
diff --git
a/src/bootchart/svg.c
b/src/bootchart/svg.c
index cd896895c9ba2adf650d60b0d8b91150351be3e1..1e87fb57391af96aecea39d364506c19f5c8bd1a 100644
(file)
--- a/
src/bootchart/svg.c
+++ b/
src/bootchart/svg.c
@@
-44,9
+44,6
@@
#define kb_to_graph(m) ((m) * arg_scale_y * 0.0001)
#define to_color(n) (192.0 - ((n) * 192.0))
#define kb_to_graph(m) ((m) * arg_scale_y * 0.0001)
#define to_color(n) (192.0 - ((n) * 192.0))
-#define max(x, y) (((x) > (y)) ? (x) : (y))
-#define min(x, y) (((x) < (y)) ? (x) : (y))
-
static char str[8092];
#define svg(a...) do { snprintf(str, 8092, ## a); fputs(str, of); fflush(of); } while (0)
static char str[8092];
#define svg(a...) do { snprintf(str, 8092, ## a); fputs(str, of); fflush(of); } while (0)
@@
-392,7
+389,7
@@
static void svg_pss_graph(void) {
svg("\n\n<!-- PSS map - csv format -->\n");
ps = ps_first;
while (ps->next_ps) {
svg("\n\n<!-- PSS map - csv format -->\n");
ps = ps_first;
while (ps->next_ps) {
-
char _cleanup_free_
*enc_name = NULL;
+
_cleanup_free_ char
*enc_name = NULL;
ps = ps->next_ps;
if (!ps)
continue;
ps = ps->next_ps;
if (!ps)
continue;
@@
-441,8
+438,8
@@
static void svg_io_bi_bar(void) {
int stop;
double tot;
int stop;
double tot;
- start =
max
(i - ((range / 2) - 1), 0);
- stop =
min
(i + (range / 2), samples - 1);
+ start =
MAX
(i - ((range / 2) - 1), 0);
+ stop =
MIN
(i + (range / 2), samples - 1);
tot = (double)(blockstat[stop].bi - blockstat[start].bi)
/ (stop - start);
tot = (double)(blockstat[stop].bi - blockstat[start].bi)
/ (stop - start);
@@
-463,8
+460,8
@@
static void svg_io_bi_bar(void) {
double tot;
double pbi;
double tot;
double pbi;
- start =
max
(i - ((range / 2) - 1), 0);
- stop =
min
(i + (range / 2), samples);
+ start =
MAX
(i - ((range / 2) - 1), 0);
+ stop =
MIN
(i + (range / 2), samples);
tot = (double)(blockstat[stop].bi - blockstat[start].bi)
/ (stop - start);
tot = (double)(blockstat[stop].bi - blockstat[start].bi)
/ (stop - start);
@@
-517,8
+514,8
@@
static void svg_io_bo_bar(void) {
int stop;
double tot;
int stop;
double tot;
- start =
max
(i - ((range / 2) - 1), 0);
- stop =
min
(i + (range / 2), samples - 1);
+ start =
MAX
(i - ((range / 2) - 1), 0);
+ stop =
MIN
(i + (range / 2), samples - 1);
tot = (double)(blockstat[stop].bi - blockstat[start].bi)
/ (stop - start);
tot = (double)(blockstat[stop].bi - blockstat[start].bi)
/ (stop - start);
@@
-539,8
+536,8
@@
static void svg_io_bo_bar(void) {
double tot;
double pbo;
double tot;
double pbo;
- start =
max
(i - ((range / 2) - 1), 0);
- stop =
min
(i + (range / 2), samples);
+ start =
MAX
(i - ((range / 2) - 1), 0);
+ stop =
MIN
(i + (range / 2), samples);
tot = (double)(blockstat[stop].bo - blockstat[start].bo)
/ (stop - start);
tot = (double)(blockstat[stop].bo - blockstat[start].bo)
/ (stop - start);
@@
-714,7
+711,7
@@
static int ps_filter(struct ps_struct *ps) {
}
static void svg_do_initcall(int count_only) {
}
static void svg_do_initcall(int count_only) {
-
FILE _cleanup_pclose_
*f = NULL;
+
_cleanup_pclose_ FILE
*f = NULL;
double t;
char func[256];
int ret;
double t;
char func[256];
int ret;
@@
-818,14
+815,11
@@
static void svg_ps_bars(void) {
/* pass 2 - ps boxes */
ps = ps_first;
while ((ps = get_next_ps(ps))) {
/* pass 2 - ps boxes */
ps = ps_first;
while ((ps = get_next_ps(ps))) {
-
char _cleanup_free_
*enc_name = NULL;
+
_cleanup_free_ char
*enc_name = NULL;
double starttime;
int t;
double starttime;
int t;
- if (!ps)
- continue;
-
enc_name = xml_comment_encode(ps->name);
if(!enc_name)
continue;
enc_name = xml_comment_encode(ps->name);
if(!enc_name)
continue;
@@
-984,12
+978,11
@@
static void svg_ps_bars(void) {
static void svg_top_ten_cpu(void) {
struct ps_struct *top[10];
static void svg_top_ten_cpu(void) {
struct ps_struct *top[10];
- struct ps_struct emptyps;
+ struct ps_struct emptyps
= {}
;
struct ps_struct *ps;
int n, m;
struct ps_struct *ps;
int n, m;
- memset(&emptyps, 0, sizeof(struct ps_struct));
- for (n=0; n < 10; n++)
+ for (n = 0; n < (int) ELEMENTSOF(top); n++)
top[n] = &emptyps;
/* walk all ps's and setup ptrs */
top[n] = &emptyps;
/* walk all ps's and setup ptrs */
@@
-1017,12
+1010,11
@@
static void svg_top_ten_cpu(void) {
static void svg_top_ten_pss(void) {
struct ps_struct *top[10];
static void svg_top_ten_pss(void) {
struct ps_struct *top[10];
- struct ps_struct emptyps;
+ struct ps_struct emptyps
= {}
;
struct ps_struct *ps;
int n, m;
struct ps_struct *ps;
int n, m;
- memset(&emptyps, 0, sizeof(struct ps_struct));
- for (n=0; n < 10; n++)
+ for (n = 0; n < (int) ELEMENTSOF(top); n++)
top[n] = &emptyps;
/* walk all ps's and setup ptrs */
top[n] = &emptyps;
/* walk all ps's and setup ptrs */