Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MojitOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sepia-pub
MojitOS
Commits
e13ea0e1
Commit
e13ea0e1
authored
2 months ago
by
Georges Da Costa
Browse files
Options
Downloads
Patches
Plain Diff
Packaging
parent
da5a42a5
No related branches found
No related tags found
No related merge requests found
Pipeline
#11462
failed
2 months ago
Stage: build-option
Stage: build
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
doc/mojitos.pre.1
+23
-4
23 additions, 4 deletions
doc/mojitos.pre.1
src/display_manager.c
+11
-0
11 additions, 0 deletions
src/display_manager.c
src/mojitos.c
+5
-7
5 additions, 7 deletions
src/mojitos.c
src/prometeus_manager.c
+3
-1
3 additions, 1 deletion
src/prometeus_manager.c
with
42 additions
and
12 deletions
doc/mojitos.pre.1
+
23
−
4
View file @
e13ea0e1
...
@@ -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 ,
...
...
This diff is collapsed.
Click to expand it.
src/display_manager.c
+
11
−
0
View file @
e13ea0e1
...
@@ -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
++
)
{
...
...
This diff is collapsed.
Click to expand it.
src/mojitos.c
+
5
−
7
View file @
e13ea0e1
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
src/prometeus_manager.c
+
3
−
1
View file @
e13ea0e1
...
@@ -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
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment