Skip to content
Snippets Groups Projects
Commit e13ea0e1 authored by Georges Da Costa's avatar Georges Da Costa
Browse files

Packaging

parent da5a42a5
No related branches found
No related tags found
No related merge requests found
Pipeline #11462 failed
...@@ -8,7 +8,11 @@ ...@@ -8,7 +8,11 @@
.Nm mojitos .Nm mojitos
.Op Ar OPTIONS .Op Ar OPTIONS
.Op Ar SENSOR ... .Op Ar SENSOR ...
.Op Fl e Ar cmd ... .Op Fl - Ar cmd ...
.Nm mojitos_prometeus
.Op Ar OPTIONS
.Op Ar SENSOR ...
.Op Fl - Ar cmd ...
.Sh DESCRIPTION .Sh DESCRIPTION
.Nm .Nm
is a monitoring tool with a multitude of sensors that does measurements at the OS level. is a monitoring tool with a multitude of sensors that does measurements at the OS level.
...@@ -35,7 +39,7 @@ In the context of cache performance counters (as with "cache_ll_r_a"), ...@@ -35,7 +39,7 @@ In the context of cache performance counters (as with "cache_ll_r_a"),
while the _a, _m and _p ones mean respectively access, miss and pending. while the _a, _m and _p ones mean respectively access, miss and pending.
.Pp .Pp
.Bd -literal -offset indent .Bd -literal -offset indent
$ ./mojitos -t 4 -f 1 -p cpu_cycles,cache_ll_r_a,page_faults $ mojitos -t 4 -f 1 -p cpu_cycles,cache_ll_r_a,page_faults
#timestamp cpu_cycles cache_ll page_faults #timestamp cpu_cycles cache_ll page_faults
1036846.351749455 571199 1232 0 1036846.351749455 571199 1232 0
1036847.001098880 348173344 2451387 872 1036847.001098880 348173344 2451387 872
...@@ -48,7 +52,7 @@ rxp and txp are the number of received and sent packets, while rxb and txp are ...@@ -48,7 +52,7 @@ rxp and txp are the number of received and sent packets, while rxb and txp are
the number of received and sent bytes. the number of received and sent bytes.
.Pp .Pp
.Bd -literal -offset indent .Bd -literal -offset indent
$ ./mojitos -t 0 -f 1 -d enp0s25 $ mojitos -t 0 -f 1 -d enp0s25
#timestamp rxp rxb txp txb #timestamp rxp rxb txp txb
1036559.277376027 0 0 0 0 1036559.277376027 0 0 0 0
1036560.000161101 4 581 2 179 1036560.000161101 4 581 2 179
...@@ -61,7 +65,7 @@ $ ./mojitos -t 0 -f 1 -d enp0s25 ...@@ -61,7 +65,7 @@ $ ./mojitos -t 0 -f 1 -d enp0s25
overhead of the monitoring when using RAPL and the cpu_cycle performance counter: overhead of the monitoring when using RAPL and the cpu_cycle performance counter:
.Pp .Pp
.Bd -literal -offset indent .Bd -literal -offset indent
$ ./mojitos -t 5 -f 1 -p cpu_cycles -r -s $ mojitos -t 5 -f 1 -p cpu_cycles -r -s
#timestamp cpu_cycles package-00 core0 dram0 overhead #timestamp cpu_cycles package-00 core0 dram0 overhead
1036988.197227391 162214 19898 4944 1586 149612 1036988.197227391 162214 19898 4944 1586 149612
1036989.000151326 332613664 2513116 379577 1115171 739573 1036989.000151326 332613664 2513116 379577 1115171 739573
...@@ -69,6 +73,21 @@ $ ./mojitos -t 5 -f 1 -p cpu_cycles -r -s ...@@ -69,6 +73,21 @@ $ ./mojitos -t 5 -f 1 -p cpu_cycles -r -s
1036991.000182835 525984292 3592582 691221 1385982 272182 1036991.000182835 525984292 3592582 691221 1385982 272182
1036992.000165117 397678789 2770561 444030 1375729 510379 1036992.000165117 397678789 2770561 444030 1375729 510379
.Ed .Ed
.Pp
system load with output in a file running the sleep 2 command that stops when the command finishes
.Pp
.Bd -literal -offset indent
$ mojitos -o output.csv -- sleep 2
.Ed
.Pp
prometeus plugin listening on the 9999 port at a 10Hz frequency for all network data
.Pp
.Bd -literal -offset indent
$ mojitos_prometeus -o 9999 -d X -f 10
.Ed
.Sh SEE ALSO .Sh SEE ALSO
.Xr perf 1 , .Xr perf 1 ,
.Xr lscpu 1 , .Xr lscpu 1 ,
......
...@@ -2,9 +2,20 @@ ...@@ -2,9 +2,20 @@
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <inttypes.h> #include <inttypes.h>
#include <stdlib.h>
#include "util.h"
extern FILE *output; extern FILE *output;
extern char* output_option;
void init_manager(char** labels, int nb_sensors, int stat_mode) { void init_manager(char** labels, int nb_sensors, int stat_mode) {
if ((output = fopen(output_option, "wb")) == NULL) {
perror("fopen");
PANIC(1, "-o %s", output_option);
}
fprintf(output, "#timestamp "); fprintf(output, "#timestamp ");
for (int i = 0; i < nb_sensors; i++) { for (int i = 0; i < nb_sensors; i++) {
......
...@@ -53,9 +53,9 @@ Optparse opts[NB_OPT + 1] = { ...@@ -53,9 +53,9 @@ Optparse opts[NB_OPT + 1] = {
.usage_msg = "set duration value (seconds). If 0, then loops infinitely.", .usage_msg = "set duration value (seconds). If 0, then loops infinitely.",
}, },
{ {
.longname = "logfile", .shortname = 'o', .argtype = OPTPARSE_REQUIRED, .longname = "option", .shortname = 'o', .argtype = OPTPARSE_REQUIRED,
.usage_arg = "<file>", .usage_arg = "<output file> or <port number>",
.usage_msg = "specify a log file.", .usage_msg = "specify a log file for MojitO/S or a port number for prometeus_mojitO/S.",
}, },
{ {
.longname = "overhead-stats", .shortname = 's', .argtype = OPTPARSE_NONE, .longname = "overhead-stats", .shortname = 's', .argtype = OPTPARSE_NONE,
...@@ -124,6 +124,7 @@ void flush(int none) ...@@ -124,6 +124,7 @@ void flush(int none)
} }
FILE *output; FILE *output;
char *output_option=NULL;
void flushexit(void) void flushexit(void)
{ {
...@@ -173,10 +174,7 @@ int main(int argc, char **argv) ...@@ -173,10 +174,7 @@ int main(int argc, char **argv)
stat_mode = 0; stat_mode = 0;
break; break;
case 'o': case 'o':
if ((output = fopen(options.optarg, "wb")) == NULL) { output_option = options.optarg;
perror("fopen");
PANIC(1, "-o %s", options.optarg);
}
break; break;
default: default:
break; break;
......
...@@ -69,7 +69,7 @@ internal_server(void * cls, ...@@ -69,7 +69,7 @@ internal_server(void * cls,
return ret; return ret;
} }
extern char* output_option;
void init_manager(char** labels, int nb_sensors, int stat_mode) { void init_manager(char** labels, int nb_sensors, int stat_mode) {
UNUSED(nb_sensors); UNUSED(nb_sensors);
...@@ -80,6 +80,8 @@ void init_manager(char** labels, int nb_sensors, int stat_mode) { ...@@ -80,6 +80,8 @@ void init_manager(char** labels, int nb_sensors, int stat_mode) {
atexit(end_mutex); atexit(end_mutex);
int port = 9999; int port = 9999;
if (output_option != NULL)
port = atoi(output_option);
d = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY, d = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY,
port, port,
NULL, NULL,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment