diff options
author | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2010-02-23 10:34:14 +0000 |
---|---|---|
committer | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2010-02-23 10:34:14 +0000 |
commit | ed7d79f96177044949744da10f4431c1d6242241 (patch) | |
tree | 3aabaa55ed3b5291daef891cfee9befb5235e2b8 /scripts/thread_analysis.c | |
parent | 7410d3c6d6a9a1cd7aa55083c938946af6ff9498 (diff) | |
download | vyos-strongswan-ed7d79f96177044949744da10f4431c1d6242241.tar.gz vyos-strongswan-ed7d79f96177044949744da10f4431c1d6242241.zip |
[svn-upgrade] Integrating new upstream version, strongswan (4.3.6)
Diffstat (limited to 'scripts/thread_analysis.c')
-rw-r--r-- | scripts/thread_analysis.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/scripts/thread_analysis.c b/scripts/thread_analysis.c index 53cd04359..7670ce1f8 100644 --- a/scripts/thread_analysis.c +++ b/scripts/thread_analysis.c @@ -1,5 +1,5 @@ /* Analyzes the concurrent use of charon's threads - * + * * Copyright (C) 2008 Andreas Steffen * Hochschule fuer Technik Rapperswil * @@ -52,7 +52,7 @@ static int readline(FILE *fd, char *line) *line = '\0'; return 1; } - line++; + line++; } *line = '\0'; return 0; @@ -69,14 +69,14 @@ static void printline(state_t *state, char *timestamp) for (th = 1; th <= THREADS; th++) { states[state[th]]++; - printf("<td class=\"%s\"></td>", state_names[state[th]]); + printf("<td class=\"%s\"></td>", state_names[state[th]]); } total = states[STATE_INIT] + states[STATE_AUTH] + states[STATE_BUSY] + states[STATE_RETRY]; printf("<td class=\"init\">%d</td><td class=\"auth\">%d</td><td class=\"busy\">%d</td>", states[STATE_INIT], states[STATE_AUTH], total); for (th = 10; th <= (THREADS + 2); th += 5) { - printf("<td class=\"%s\"></td>", (th <= total + 2)? "busy":"idle"); + printf("<td class=\"%s\"></td>", (th <= total + 2)? "busy":"idle"); } printf("\n"); printf(" </tr>\n"); @@ -91,13 +91,13 @@ int main(int argc, char *argv[]) FILE *fd; state_t state[THREADS + 1]; - + /* threads 1..5 and 9 are always busy */ for (th = 1; th <= THREADS; th++) { state[th] = (th <= 7 && th != 3)? STATE_BUSY : STATE_IDLE; } - + /* open the log file */ fd = fopen(LOGFILE, "r"); if (!fd) @@ -135,16 +135,16 @@ int main(int argc, char *argv[]) printf(" <td class=\"log\">Timestamp</td>"); for (th = 1 ; th <= THREADS; th++) { - printf("<td>%02d</td>", th); + printf("<td>%02d</td>", th); } printf("<td class=\"init\">I</td><td class=\"auth\">A</td><td class=\"busy\">B</td>"); for (th = 10; th <= (THREADS + 2); th += 5) { - printf("<td class=\"busy\">%d</td>", (th == 100)? 99:th); + printf("<td class=\"busy\">%d</td>", (th == 100)? 99:th); } printf("\n"); printf(" </tr>\n"); - + while (readline(fd, line)) { char *p_section, *p_charon, *p_thread, *p_log; @@ -170,7 +170,7 @@ int main(int argc, char *argv[]) { continue; } - + /* determine thread */ p_thread = p_charon + 8; th = atol(p_thread); @@ -268,6 +268,6 @@ int main(int argc, char *argv[]) printf("</body>\n"); printf("</html>\n"); - fclose(fd); + fclose(fd); return 0; } |