Compare commits

..
10 Commits
Author SHA1 Message Date
Patrick McCarty 356be6738f Release v1.11.2
This release includes a couple of fixes for the man pages.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-04-06 09:59:36 -07:00
Auke Kok e73870b916 Fix wrong reference to the config file in man pages. 2017-04-06 09:57:50 -07:00
Auke Kok c7e783f2b1 Add FILES section, explain static machine id file. 2017-04-06 09:57:50 -07:00
Patrick McCarty 3bb04aff3f Release v1.11.1
This release includes updates for man pages and improves support for the
new oops format in Linux 4.10 and newer.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-03-22 10:49:26 -07:00
Patrick McCarty 26fc7b69bb Fix make distcheck
I forgot to add the new test file to EXTRA_DIST, so add it here.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-03-22 10:48:54 -07:00
Auke Kok e3ede3cd88 Refresh the existing man pages' output.
Made with `make manpages` of course.
2017-03-21 22:57:07 -07:00
Auke Kok dd44e91d4a Convert man pages to RST. 2017-03-21 22:57:07 -07:00
Patrick McCarty a403d884bc tests: add test case for new oops format
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-03-21 22:55:03 -07:00
Patrick McCarty e699fd34e2 oops parser: support oops stack traces for Linux 4.10+
Linux 4.10 introduced some format changes for oopses; one of the changes
was removing memory addresses from each stack frame.

This commit adds support for the new format and retains compatibility
for the previous format (4.9 and earlier).

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-03-21 22:55:03 -07:00
Patrick McCarty 266039a4e5 oops parser: add/use skip_space; fix skip_spaces
The former skip_spaces() function only skipped a single space, so rename
it to skip_space(), and make skip_spaces() greedily consume spaces.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-03-21 22:55:03 -07:00
21 changed files with 1036 additions and 697 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([telemetrics-client], [1.11.0], [https://clearlinux.org/])
AC_INIT([telemetrics-client], [1.11.2], [https://clearlinux.org/])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([1.14 -Wall -Werror -Wno-extra-portability foreign subdir-objects])
AM_SILENT_RULES([yes])
+2 -2
View File
@@ -13,8 +13,8 @@ MANLINKS = \
manpages:
for MANPAGE in $(MANPAGES); do \
ronn --roff < $${MANPAGE}.md > $${MANPAGE}; \
ronn --html < $${MANPAGE}.md > $${MANPAGE}.html; \
rst2man.py $${MANPAGE}.rst > $${MANPAGE}; \
rst2html.py $${MANPAGE}.rst > $${MANPAGE}.html; \
done
dist_man_MANS = \
+94 -77
View File
@@ -1,81 +1,98 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.\" Man page generated from reStructuredText.
.
.TH "TELEM\-RECORD\-GEN" "1" "December 2016" "" ""
.TH TELEM-RECORD-GEN 1 "" "" ""
.SH NAME
telem-record-gen \- Create custom telemetry record
.
.SH "NAME"
\fBtelem\-record\-gen\fR \- Create custom telemetry record
.nr rst2man-indent-level 0
.
.SH "SYNOPSIS"
\fBtelem\-record\-gen\fR \fIoptions\fR
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH SYNOPSIS
.sp
\fBtelem\-record\-gen\fP <options>
.SH DESCRIPTION
.sp
Generate and attempt to send a telemetry record to \fBtelemd\fP(1). This
program can be used to create a telemetry record from a shell script
or from another program using e.g. \fBsystem()\fP\&. The program connects
to a local \fBtelemd\fP(1) daemon to spool the record for delivery to
the actual collection service.
.sp
The payload can be provided as standard input, as a file with the
\fB\-\-payload\-file\fP option, or as a string argument with the \fB\-\-payload\fP
option. If neither the \fB\-\-payload\fP or \fB\-\-payload\-file\fP is provided,
the payload is assumed to be on <stdin>.
.sp
Each record is expected to have a class identifier, a record version
number, and a severity level. A class identifier is required to be
provided.
.SH OPTIONS
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fB\-h\fP, \fB\-\-help\fP:
Show help options.
.IP \(bu 2
\fB\-V\fP, \fB\-\-version\fP:
Print the program version.
.IP \(bu 2
\fB\-f\fP, \fB\-\-config\-file\fP <file>:
Path to configuration file (not implemented yet).
.IP \(bu 2
\fB\-s\fP, \fB\-\-severity\fP:
Severity level (1\-4) \- (default 1).
.IP \(bu 2
\fB\-c\fP, \fB\-\-class\fP:
Classification \fBlevel_1\fP/\fBlevel_2\fP/\fBlevel_3\fP\&.
.IP \(bu 2
\fB\-p\fP, \fB\-\-payload\fP <payload>:
Record body (max size = 8k).
.IP \(bu 2
\fB\-P\fP, \fB\-\-payload\-file\fP <file>:
File to read payload from.
.IP \(bu 2
\fB\-R\fP, \fB\-\-record\-version\fP <version>:
Version number for format of payload (default 1).
.UNINDENT
.UNINDENT
.UNINDENT
.SH RETURN VALUES
.sp
0 on success. A non\-zero exit code indicates a failure occurred.
.SH SEE ALSO
.INDENT 0.0
.IP \(bu 2
\fBtelemd\fP(1)
.IP \(bu 2
\fI\%https://github.com/clearlinux/telemetrics\-client\fP
.IP \(bu 2
\fI\%https://clearlinux.org/documentation/\fP
.UNINDENT
.SH COPYRIGHT
(C) 2017 Intel Corporation, CC-BY-SA-3.0
.\" Generated by docutils manpage writer.
.
.SH "DESCRIPTION"
Generate and attempt to send a telemetry record to \fBtelemd(1)\fR\. This program can be used to create a telemetry record from a shell script or from another program using e\.g\. \fBsystem()\fR\. The program connects to a local \fBtelemd(1)\fR daemon to spool the record for delivery to the actual collection service\.
.
.P
The payload can be provided as standard input, as a file with the \fB\-\-payload\-file\fR option, or as a string argument with the \fB\-\-payload\fR option\. If neither the \fB\-\-payload\fR or \fB\-\-payload\-file\fR is provided, the payload is assumed to be on \fIstdin\fR\.
.
.P
Each record is expected to have a class identifier, a record version number, and a severity level\. A class identifier is required to be provided\.
.
.SH "OPTIONS"
.
.TP
\fB\-h\fR, \fB\-\-help\fR
Show help options\.
.
.TP
\fB\-V\fR, \fB\-\-version\fR
Print the program version\.
.
.TP
\fB\-f\fR, \fB\-\-config\-file\fR \fIfile\fR
Path to configuration file (not implemented yet)\.
.
.TP
\fB\-s\fR, \fB\-\-severity\fR
Severity level (1\-4) \- (default 1)\.
.
.TP
\fB\-c\fR, \fB\-\-class\fR
Classification \fBlevel_1\fR/\fBlevel_2\fR/\fBlevel_3\fR\.
.
.TP
\fB\-p\fR, \fB\-\-payload\fR \fIpayload\fR
Record body (max size = 8k)\.
.
.TP
\fB\-P\fR, \fB\-\-payload\-file\fR \fIfile\fR
File to read payload from\.
.
.TP
\fB\-R\fR, \fB\-\-record\-version\fR \fIversion\fR
Version number for format of payload (default 1)\.
.
.SH "RETURN VALUES"
0 on success\. A non\-zero exit code indicates a failure occurred\.
.
.SH "COPYRIGHT"
.
.IP "\(bu" 4
Copyright (C) 2016 Intel Corporation, License: CC\-BY\-SA\-3\.0
.
.IP "" 0
.
.SH "SEE ALSO"
\fBtelemd(1)\fR
.
.P
https://github\.com/clearlinux/telemetrics\-client
.
.P
https://clearlinux\.org/documentation/
.
.SH "NOTES"
Creative Commons Attribution\-ShareAlike 3\.0 Unported
.
.IP "\(bu" 4
http://creativecommons\.org/licenses/by\-sa/3\.0/
.
.IP "" 0
-70
View File
@@ -1,70 +0,0 @@
telem-record-gen(1) -- Create custom telemetry record
=====================================================
## SYNOPSIS
`telem-record-gen` <options>
## DESCRIPTION
Generate and attempt to send a telemetry record to `telemd(1)`. This
program can be used to create a telemetry record from a shell script
or from another program using e.g. `system()`. The program connects
to a local `telemd(1)` daemon to spool the record for delivery to
the actual collection service.
The payload can be provided as standard input, as a file with the
`--payload-file` option, or as a string argument with the `--payload`
option. If neither the `--payload` or `--payload-file` is provided,
the payload is assumed to be on <stdin>.
Each record is expected to have a class identifier, a record version
number, and a severity level. A class identifier is required to be
provided.
## OPTIONS
* `-h`, `--help`:
Show help options.
* `-V`, `--version`:
Print the program version.
* `-f`, `--config-file` <file>:
Path to configuration file (not implemented yet).
* `-s`, `--severity`:
Severity level (1-4) - (default 1).
* `-c`, `--class`:
Classification `level_1`/`level_2`/`level_3`.
* `-p`, `--payload` <payload>:
Record body (max size = 8k).
* `-P`, `--payload-file` <file>:
File to read payload from.
* `-R`, `--record-version` <version>:
Version number for format of payload (default 1).
## RETURN VALUES
0 on success. A non-zero exit code indicates a failure occurred.
## COPYRIGHT
* Copyright (C) 2016 Intel Corporation, License: CC-BY-SA-3.0
## SEE ALSO
`telemd(1)`
https://github.com/clearlinux/telemetrics-client
https://clearlinux.org/documentation/
## NOTES
Creative Commons Attribution-ShareAlike 3.0 Unported
* http://creativecommons.org/licenses/by-sa/3.0/
+78
View File
@@ -0,0 +1,78 @@
================
telem-record-gen
================
------------------------------
Create custom telemetry record
------------------------------
:Copyright: \(C) 2017 Intel Corporation, CC-BY-SA-3.0
:Manual section: 1
SYNOPSIS
========
``telem-record-gen`` <options>
DESCRIPTION
===========
Generate and attempt to send a telemetry record to ``telemd``\(1). This
program can be used to create a telemetry record from a shell script
or from another program using e.g. ``system()``. The program connects
to a local ``telemd``\(1) daemon to spool the record for delivery to
the actual collection service.
The payload can be provided as standard input, as a file with the
``--payload-file`` option, or as a string argument with the ``--payload``
option. If neither the ``--payload`` or ``--payload-file`` is provided,
the payload is assumed to be on <stdin>.
Each record is expected to have a class identifier, a record version
number, and a severity level. A class identifier is required to be
provided.
OPTIONS
=======
* ``-h``, ``--help``:
Show help options.
* ``-V``, ``--version``:
Print the program version.
* ``-f``, ``--config-file`` <file>:
Path to configuration file (not implemented yet).
* ``-s``, ``--severity``:
Severity level (1-4) - (default 1).
* ``-c``, ``--class``:
Classification ``level_1``/``level_2``/``level_3``.
* ``-p``, ``--payload`` <payload>:
Record body (max size = 8k).
* ``-P``, ``--payload-file`` <file>:
File to read payload from.
* ``-R``, ``--record-version`` <version>:
Version number for format of payload (default 1).
RETURN VALUES
=============
0 on success. A non-zero exit code indicates a failure occurred.
SEE ALSO
========
* ``telemd``\(1)
* https://github.com/clearlinux/telemetrics-client
* https://clearlinux.org/documentation/
+72 -54
View File
@@ -1,58 +1,76 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.\" Man page generated from reStructuredText.
.
.TH "TELEMCTL" "1" "December 2016" "" ""
.TH TELEMCTL 1 "" "" ""
.SH NAME
telemctl \- Telemetry service administration tool
.
.SH "NAME"
\fBtelemctl\fR \- Telemetry service administration tool
.nr rst2man-indent-level 0
.
.SH "SYNOPSIS"
\fBtelemctl\fR
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH SYNOPSIS
.sp
\fBtelemctl\fP
.sp
\fB/etc/telemetrics/opt\-out\fP
.SH DESCRIPTION
.sp
Control actions for telemetry services. The command can be used to start,
restart, or stop \fBtelemd\fP(1), or to opt\-in or opt\-out of telemetry delivery
of records to a central telemetry service.
.SH OPTIONS
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fBstart\(ga\(ga|\(ga\(gastop\(ga\(ga|\(ga\(garestart\fP:
Starts, stops or restarts all running telemetry services.
.IP \(bu 2
\fBopt\-in\fP:
Opts in to telemetry, and starts telemetry services. The opt\-out file
\fB/etc/telemetrics/opt\-out\fP is removed.
.IP \(bu 2
\fBopt\-out\fP:
Opts out of telemetry, and stops telemetry services. The opt\-out file
\fB/etc/telemetrics/opt\-out\fP is created.
.UNINDENT
.UNINDENT
.UNINDENT
.SH RETURN VALUES
.sp
0 on success. A non\-zero exit code indicates a failure occurred.
.SH SEE ALSO
.INDENT 0.0
.IP \(bu 2
\fBtelemd\fP(1)
.IP \(bu 2
\fI\%https://github.com/clearlinux/telemetrics\-client\fP
.IP \(bu 2
\fI\%https://clearlinux.org/documentation/\fP
.UNINDENT
.SH COPYRIGHT
(C) 2017 Intel Corporation, CC-BY-SA-3.0
.\" Generated by docutils manpage writer.
.
.P
\fB/etc/telemetrics/opt\-out\fR
.
.SH "DESCRIPTION"
Control actions for telemetry services\. The command can be used to start, restart, or stop \fBtelemd(1)\fR, or to opt\-in or opt\-out of telemetry delivery of records to a central telemetry service\.
.
.SH "OPTIONS"
.
.TP
\fBstart\fR|\fBstop\fR|\fBrestart\fR
Starts, stops or restarts all running telemetry services\.
.
.TP
\fBopt\-in\fR
Opts in to telemetry, and starts telemetry services\. The opt\-out file \fB/etc/telemetrics/opt\-out\fR is removed\.
.
.TP
\fBopt\-out\fR
Opts out of telemetry, and stops telemetry services\. The opt\-out file \fB/etc/telemetrics/opt\-out\fR is created\.
.
.SH "RETURN VALUES"
0 on success\. A non\-zero exit code indicates a failure occurred\.
.
.SH "COPYRIGHT"
.
.IP "\(bu" 4
Copyright (C) 2016 Intel Corporation, License: CC\-BY\-SA\-3\.0
.
.IP "" 0
.
.SH "SEE ALSO"
\fBtelemd(1)\fR
.
.P
https://github\.com/clearlinux/telemetrics\-client
.
.P
https://clearlinux\.org/documentation/
.
.SH "NOTES"
Creative Commons Attribution\-ShareAlike 3\.0 Unported
.
.IP "\(bu" 4
http://creativecommons\.org/licenses/by\-sa/3\.0/
.
.IP "" 0
-49
View File
@@ -1,49 +0,0 @@
telemctl(1) -- Telemetry service administration tool
====================================================
## SYNOPSIS
`telemctl`
`/etc/telemetrics/opt-out`
## DESCRIPTION
Control actions for telemetry services. The command can be used to start,
restart, or stop `telemd(1)`, or to opt-in or opt-out of telemetry delivery
of records to a central telemetry service.
## OPTIONS
* `start`|`stop`|`restart`:
Starts, stops or restarts all running telemetry services.
* `opt-in`:
Opts in to telemetry, and starts telemetry services. The opt-out file
`/etc/telemetrics/opt-out` is removed.
* `opt-out`:
Opts out of telemetry, and stops telemetry services. The opt-out file
`/etc/telemetrics/opt-out` is created.
## RETURN VALUES
0 on success. A non-zero exit code indicates a failure occurred.
## COPYRIGHT
* Copyright (C) 2016 Intel Corporation, License: CC-BY-SA-3.0
## SEE ALSO
`telemd(1)`
https://github.com/clearlinux/telemetrics-client
https://clearlinux.org/documentation/
## NOTES
Creative Commons Attribution-ShareAlike 3.0 Unported
* http://creativecommons.org/licenses/by-sa/3.0/
+56
View File
@@ -0,0 +1,56 @@
========
telemctl
========
-------------------------------------
Telemetry service administration tool
-------------------------------------
:Copyright: \(C) 2017 Intel Corporation, CC-BY-SA-3.0
:Manual section: 1
SYNOPSIS
========
``telemctl``
``/etc/telemetrics/opt-out``
DESCRIPTION
===========
Control actions for telemetry services. The command can be used to start,
restart, or stop ``telemd``\(1), or to opt-in or opt-out of telemetry delivery
of records to a central telemetry service.
OPTIONS
=======
* ``start``|``stop``|``restart``:
Starts, stops or restarts all running telemetry services.
* ``opt-in``:
Opts in to telemetry, and starts telemetry services. The opt-out file
``/etc/telemetrics/opt-out`` is removed.
* ``opt-out``:
Opts out of telemetry, and stops telemetry services. The opt-out file
``/etc/telemetrics/opt-out`` is created.
RETURN VALUES
=============
0 on success. A non-zero exit code indicates a failure occurred.
SEE ALSO
========
* ``telemd``\(1)
* https://github.com/clearlinux/telemetrics-client
* https://clearlinux.org/documentation/
+102 -51
View File
@@ -1,55 +1,106 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.\" Man page generated from reStructuredText.
.
.TH "TELEMD" "1" "December 2016" "" ""
.TH TELEMD 1 "" "" ""
.SH NAME
telemd \- Telemetry client service
.
.SH "NAME"
\fBtelemd\fR \- Telemetry client service
.nr rst2man-indent-level 0
.
.SH "SYNOPSIS"
\fBtelemd\fR \fIflags\fR \fB/etc/telemetrics/telemetrics\.conf\fR
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH SYNOPSIS
.sp
\fBtelemd\fP <flags>
.sp
\fB/etc/telemetrics/telemetrics.conf\fP
.sp
\fB/usr/share/defaults/telemetrics/telemetrics.conf\fP
.sp
\fB/etc/telemetrics/opt\-in\-static\-machine\-id\fP
.SH DESCRIPTION
.sp
The \fBtelemd\fP program delivers locally generated telemetry records to a remote
telemetry service. Telemetry data can be in any format, and is relayed as\-is.
.SH OPTIONS
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fB\-f\fP, \fB\-\-config_file\fP [<file>]:
Configuration file. This overides the other parameters.
.IP \(bu 2
\fB\-h\fP, \fB\-\-help\fP:
Display this help message.
.IP \(bu 2
\fB\-V\fP, \fB\-\-version\fP:
Print the program version.
.UNINDENT
.UNINDENT
.UNINDENT
.SH FILES
.INDENT 0.0
.IP \(bu 2
\fB/usr/share/defaults/telemetrics/telemetrics.conf\fP
.INDENT 2.0
.INDENT 3.5
If no custom configuration file is found, \fBtelemd\fP uses the
settings in this file.
.UNINDENT
.UNINDENT
.IP \(bu 2
\fB/etc/telemetrics/telemetrics.conf\fP
.INDENT 2.0
.INDENT 3.5
Custom configuration file that \fBtelemd\fP reads. See \fBtelemetrics.conf\fP(5).
.UNINDENT
.UNINDENT
.IP \(bu 2
\fB/etc/telemetrics/opt\-in\-static\-machine\-id\fP
.INDENT 2.0
.INDENT 3.5
If this file exists, the first line of this file will be sent to
the server as the machine ID. Otherwise, the machine ID will be
random and changed regularly.
.UNINDENT
.UNINDENT
.UNINDENT
.SH EXIT STATUS
.sp
0 when no errors occurred. A non\-zero exit status indicates a failure occurred.
.SH SEE ALSO
.INDENT 0.0
.IP \(bu 2
\fBtelemetry\fP(3)
.IP \(bu 2
\fBtelemetrics.conf\fP(5)
.IP \(bu 2
\fI\%https://github.com/clearlinux/telemetrics\-client\fP
.IP \(bu 2
\fI\%https://clearlinux.org/documentation/\fP
.UNINDENT
.SH COPYRIGHT
(C) 2017 Intel Corporation, CC-BY-SA-3.0
.\" Generated by docutils manpage writer.
.
.SH "DESCRIPTION"
The \fBtelemd\fR program delivers locally generated telemetry records to a remote telemetry service\. Telemetry data can be in any format, and is relayed as\-is\.
.
.SH "OPTIONS"
.
.TP
\fB\-f\fR, \fB\-\-config_file\fR [\fIfile\fR]
Configuration file\. This overides the other parameters\.
.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display this help message\.
.
.TP
\fB\-V\fR, \fB\-\-version\fR
Print the program version\.
.
.SH "EXIT STATUS"
0 when no errors occurred\. A non\-zero exit status indicates a failure occurred\.
.
.SH "COPYRIGHT"
.
.IP "\(bu" 4
Copyright (C) 2016 Intel Corporation, License: CC\-BY\-SA\-3\.0
.
.IP "" 0
.
.SH "SEE ALSO"
\fBtelemetry(3)\fR \fBtelemetrics\-client\.conf(5)\fR
.
.P
https://github\.com/clearlinux/telemetrics\-client
.
.P
https://clearlinux\.org/documentation/
.
.SH "NOTES"
Creative Commons Attribution\-ShareAlike 3\.0 Unported
.
.IP "\(bu" 4
http://creativecommons\.org/licenses/by\-sa/3\.0/
.
.IP "" 0
-47
View File
@@ -1,47 +0,0 @@
telemd(1) -- Telemetry client service
=====================================
## SYNOPSIS
`telemd` <flags>
`/etc/telemetrics/telemetrics.conf`
## DESCRIPTION
The `telemd` program delivers locally generated telemetry records to a remote
telemetry service. Telemetry data can be in any format, and is relayed as-is.
## OPTIONS
* `-f`, `--config_file` [<file>]:
Configuration file. This overides the other parameters.
* `-h`, `--help`:
Display this help message.
* `-V`, `--version`:
Print the program version.
## EXIT STATUS
0 when no errors occurred. A non-zero exit status indicates a failure occurred.
## COPYRIGHT
* Copyright (C) 2016 Intel Corporation, License: CC-BY-SA-3.0
## SEE ALSO
`telemetry(3)`
`telemetrics-client.conf(5)`
https://github.com/clearlinux/telemetrics-client
https://clearlinux.org/documentation/
## NOTES
Creative Commons Attribution-ShareAlike 3.0 Unported
* http://creativecommons.org/licenses/by-sa/3.0/
+78
View File
@@ -0,0 +1,78 @@
======
telemd
======
------------------------
Telemetry client service
------------------------
:Copyright: \(C) 2017 Intel Corporation, CC-BY-SA-3.0
:Manual section: 1
SYNOPSIS
========
``telemd`` \<flags\>
``/etc/telemetrics/telemetrics.conf``
``/usr/share/defaults/telemetrics/telemetrics.conf``
``/etc/telemetrics/opt-in-static-machine-id``
DESCRIPTION
===========
The ``telemd`` program delivers locally generated telemetry records to a remote
telemetry service. Telemetry data can be in any format, and is relayed as-is.
OPTIONS
=======
* ``-f``, ``--config_file`` \[\<file\>\]:
Configuration file. This overides the other parameters.
* ``-h``, ``--help``:
Display this help message.
* ``-V``, ``--version``:
Print the program version.
FILES
=====
* ``/usr/share/defaults/telemetrics/telemetrics.conf``
If no custom configuration file is found, ``telemd`` uses the
settings in this file.
* ``/etc/telemetrics/telemetrics.conf``
Custom configuration file that ``telemd`` reads. See ``telemetrics.conf``\(5).
* ``/etc/telemetrics/opt-in-static-machine-id``
If this file exists, the first line of this file will be sent to
the server as the machine ID. Otherwise, the machine ID will be
random and changed regularly.
EXIT STATUS
===========
0 when no errors occurred. A non-zero exit status indicates a failure occurred.
SEE ALSO
========
* ``telemetry``\(3)
* ``telemetrics.conf``\(5)
* https://github.com/clearlinux/telemetrics-client
* https://clearlinux.org/documentation/
+122 -101
View File
@@ -1,105 +1,126 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.\" Man page generated from reStructuredText.
.
.TH "TELEMETRICS\.CONF" "5" "December 2016" "" ""
.TH TELEMETRICS.CONF 5 "" "" ""
.SH NAME
telemetrics.conf \- Telemetry service configuration file
.
.SH "NAME"
\fBtelemetrics\.conf\fR \- Telemetry service configuration file
.nr rst2man-indent-level 0
.
.SH "SYNOPSIS"
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH SYNOPSIS
.sp
\fB/etc/telemetrics/telemetrics.conf\fP
.sp
\fB/usr/share/defaults/telemetrics/telemetrics.conf\fP
.SH DESCRIPTION
.sp
This file contains configuration parameters for the \fBtelemd\fP(1) telemetry
service daemon. The daemon reads this file at startup if it exists.
.SH SYNTAX
.sp
The configuration file contains \fBkey=value\fP pairs, formatted as plain
text, one option per line. Comments can be added by preceding them with the
\fB#\fP character. All configuration options should be in a section marked
with \fB[settings]\fP\&.
.SH OPTIONS
.INDENT 0.0
.IP \(bu 2
\fBserver=<url>\fP
.sp
Server URL including protocol designator.
.IP \(bu 2
\fBsocket_path=<path>\fP
.sp
Path to the socket that \fItelemd\fP will listen on.
.IP \(bu 2
\fBcainfo=<path>\fP
.sp
Certificate file to use for validation of SSL endpoint.
.IP \(bu 2
\fBtidheader=<header>\fP
.sp
Telemetry ID in header format, usually \fBtidheader=X\-Telemetry\-TID:<uuid>\fP
post header used to group records in ingestion service, which may be
ingesting for more than one set of clients. Can be set to any string.
.IP \(bu 2
\fBrecord_expiry=<minutes>\fP
.sp
Record expiry time in minutes.
.IP \(bu 2
\fBspool_dir=<dir>\fP
.sp
Local spool directory used to store records being processed.
.IP \(bu 2
\fBspool_max_size=<kB>\fP
.sp
maximum size of the spool directory in kB. A value of \fB\-1\fP indicates
no limit. The block size of the files in this directory is considered,
and not the actual size of the record itself.
.IP \(bu 2
\fBspool_process_time=<seconds>\fP
.sp
Time in seconds for processing spool. Valid range: 120..3600. Values
outside this range are clamped.
.IP \(bu 2
\fBrate_limit_enabled=<true|false>\fP
.sp
Enable rate limiting. If this is set to false then all rate\-limiting
disabled. It is possible to disable each rate\-limit individually below.
.IP \(bu 2
\fBrecord_burst_limit=<limit>\fP
.sp
Rate limiting record burst limit. Valid Range: 0..\(ga\(gaINT_MAX\(ga\(ga, \-1 = disabled.
.IP \(bu 2
\fBrecord_window_length=<minutes>\fP
.sp
Rate limiting record window length in minutes. Valid Range: 0..59.
.IP \(bu 2
\fBbyte_burst_limit=<limit>\fP
.sp
Rate limiting byte burst limit. Valid Range: 0..\(gaINT_MAX\(ga, \-1 = disabled.
.IP \(bu 2
\fBbyte_window_length=<minutes>\fP
.sp
Rate limiting byte window length in minutes. Valid Range: 0..59.
.IP \(bu 2
\fBrate_limit_strategy=<strategy>\fP
.sp
Rate limit strategy \- what to do with record if rate\-limiting prevents
delivery over network. Valid stategies: \fBspool\fP, \fBdrop\fP\&.
.UNINDENT
.SH SEE ALSO
.INDENT 0.0
.IP \(bu 2
\fBtelemd\fP(1)
.IP \(bu 2
\fI\%https://github.com/clearlinux/telemetrics\-client\fP
.IP \(bu 2
\fI\%https://clearlinux.org/documentation/\fP
.UNINDENT
.SH COPYRIGHT
(C) 2017 Intel Corporation, CC-BY-SA-3.0
.\" Generated by docutils manpage writer.
.
.nf
/etc/telemetrics/telemetrics\.conf
/usr/share/defaults/telemetrics/telemetrics\.conf
.
.fi
.
.SH "DESCRIPTION"
This file contains configuration parameters for the \fBtelemd(1)\fR telemetry service daemon\. The daemon reads this file at startup if it exists\.
.
.SH "SYNTAX"
The configuration file contains \fBkey=value\fR pairs, formatted as plain text, one option per line\. Comments can be added by preceding them with the \fB#\fR character\. All configuration options should be in a section marked with \fB[settings]\fR\.
.
.SH "OPTIONS"
.
.TP
\fBserver\fR=\fIurl\fR
Server URL including protocol designator\.
.
.TP
\fBsocket_path\fR=\fIpath\fR
Path to the socket that \fBtelemd\fR will listen on\.
.
.TP
\fBcainfo\fR=\fIpath\fR
Certificate file to use for validation of SSL endpoint\.
.
.TP
\fBtidheader\fR=\fIheader\fR
Telemetry ID in header format, usually \fBtidheader=X\-Telemetry\-TID:<uuid>\fR post header used to group records in ingestion service, which may be ingesting for more than one set of clients\. Can be set to any string\.
.
.TP
\fBrecord_expiry\fR=\fIminutes\fR
Record expiry time in minutes\.
.
.TP
\fBspool_dir\fR=\fI\fBdir\fR\fR
Local spool directory used to store records being processed\.
.
.TP
\fBspool_max_size\fR=\fIkB\fR
maximum size of the spool directory in kB\. A value of \fB\-1\fR indicates no limit\. The block size of the files in this directory is considered, and not the actual size of the record itself\.
.
.TP
\fBspool_process_time\fR=\fIseconds\fR
Time in seconds for processing spool\. Valid range: 120\.\.3600\. Values outside this range are clamped\.
.
.TP
\fBrate_limit_enabled\fR=\fI\fBtrue\fR|\fBfalse\fR\fR
Enable rate limiting\. If this is set to false then all rate\-limiting disabled\. It is possible to disable each rate\-limit individually below\.
.
.TP
\fBrecord_burst_limit\fR=\fIlimit\fR
Rate limiting record burst limit\. Valid Range: 0\.\.\fBINT_MAX\fR, \-1 = disabled\.
.
.TP
\fBrecord_window_length\fR=\fIminutes\fR
Rate limiting record window length in minutes\. Valid Range: 0\.\.59\.
.
.TP
\fBbyte_burst_limit\fR=\fIlimit\fR
Rate limiting byte burst limit\. Valid Range: 0\.\.\fBINT_MAX\fR, \-1 = disabled\.
.
.TP
\fBbyte_window_length\fR=\fIminutes\fR
Rate limiting byte window length in minutes\. Valid Range: 0\.\.59\.
.
.TP
\fBrate_limit_strategy\fR=\fIstrategy\fR
Rate limit strategy \- what to do with record if rate\-limiting prevents delivery over network\. Valid stategies: \fBspool\fR, \fBdrop\fR\.
.
.SH "COPYRIGHT"
.
.IP "\(bu" 4
Copyright (C) 2016 Intel Corporation, License: CC\-BY\-SA\-3\.0
.
.IP "" 0
.
.SH "SEE ALSO"
\fBtelemd(1)\fR
.
.P
https://github\.com/clearlinux/telemetrics\-client
.
.P
https://clearlinux\.org/documentation/
.
.SH "NOTES"
Creative Commons Attribution\-ShareAlike 3\.0 Unported
.
.IP "\(bu" 4
http://creativecommons\.org/licenses/by\-sa/3\.0/
.
.IP "" 0
-92
View File
@@ -1,92 +0,0 @@
telemetrics.conf(5) -- Telemetry service configuration file
===========================================================
## SYNOPSIS
```
/etc/telemetrics/telemetrics.conf
/usr/share/defaults/telemetrics/telemetrics.conf
```
## DESCRIPTION
This file contains configuration parameters for the `telemd(1)` telemetry
service daemon. The daemon reads this file at startup if it exists.
## SYNTAX
The configuration file contains `key=value` pairs, formatted as plain
text, one option per line. Comments can be added by preceding them with the
`#` character. All configuration options should be in a section marked
with `[settings]`.
## OPTIONS
* `server`=<url>:
Server URL including protocol designator.
* `socket_path`=<path>:
Path to the socket that `telemd` will listen on.
* `cainfo`=<path>:
Certificate file to use for validation of SSL endpoint.
* `tidheader`=<header>:
Telemetry ID in header format, usually
`tidheader=X-Telemetry-TID:<uuid>`
post header used to group records in ingestion service, which may be
ingesting for more than one set of clients. Can be set to any string.
* `record_expiry`=<minutes>:
Record expiry time in minutes.
* `spool_dir`=<`dir`>:
Local spool directory used to store records being processed.
* `spool_max_size`=<kB>:
maximum size of the spool directory in kB. A value of `-1` indicates
no limit. The block size of the files in this directory is considered,
and not the actual size of the record itself.
* `spool_process_time`=<seconds>:
Time in seconds for processing spool. Valid range: 120..3600. Values
outside this range are clamped.
* `rate_limit_enabled`=<`true`|`false`>:
Enable rate limiting. If this is set to false then all rate-limiting
disabled. It is possible to disable each rate-limit individually below.
* `record_burst_limit`=<limit>:
Rate limiting record burst limit. Valid Range: 0..`INT_MAX`, -1 = disabled.
* `record_window_length`=<minutes>:
Rate limiting record window length in minutes. Valid Range: 0..59.
* `byte_burst_limit`=<limit>:
Rate limiting byte burst limit. Valid Range: 0..`INT_MAX`, -1 = disabled.
* `byte_window_length`=<minutes>:
Rate limiting byte window length in minutes. Valid Range: 0..59.
* `rate_limit_strategy`=<strategy>:
Rate limit strategy - what to do with record if rate-limiting prevents
delivery over network. Valid stategies: `spool`, `drop`.
## COPYRIGHT
* Copyright (C) 2016 Intel Corporation, License: CC-BY-SA-3.0
## SEE ALSO
`telemd(1)`
https://github.com/clearlinux/telemetrics-client
https://clearlinux.org/documentation/
## NOTES
Creative Commons Attribution-ShareAlike 3.0 Unported
* http://creativecommons.org/licenses/by-sa/3.0/
+110
View File
@@ -0,0 +1,110 @@
================
telemetrics.conf
================
------------------------------------
Telemetry service configuration file
------------------------------------
:Copyright: \(C) 2017 Intel Corporation, CC-BY-SA-3.0
:Manual section: 5
SYNOPSIS
========
``/etc/telemetrics/telemetrics.conf``
``/usr/share/defaults/telemetrics/telemetrics.conf``
DESCRIPTION
===========
This file contains configuration parameters for the ``telemd``\(1) telemetry
service daemon. The daemon reads this file at startup if it exists.
SYNTAX
======
The configuration file contains ``key=value`` pairs, formatted as plain
text, one option per line. Comments can be added by preceding them with the
``#`` character. All configuration options should be in a section marked
with ``[settings]``.
OPTIONS
=======
- ``server=<url>``
Server URL including protocol designator.
- ``socket_path=<path>``
Path to the socket that `telemd` will listen on.
- ``cainfo=<path>``
Certificate file to use for validation of SSL endpoint.
- ``tidheader=<header>``
Telemetry ID in header format, usually ``tidheader=X-Telemetry-TID:<uuid>``
post header used to group records in ingestion service, which may be
ingesting for more than one set of clients. Can be set to any string.
- ``record_expiry=<minutes>``
Record expiry time in minutes.
- ``spool_dir=<dir>``
Local spool directory used to store records being processed.
- ``spool_max_size=<kB>``
maximum size of the spool directory in kB. A value of ``-1`` indicates
no limit. The block size of the files in this directory is considered,
and not the actual size of the record itself.
- ``spool_process_time=<seconds>``
Time in seconds for processing spool. Valid range: 120..3600. Values
outside this range are clamped.
- ``rate_limit_enabled=<true|false>``
Enable rate limiting. If this is set to false then all rate-limiting
disabled. It is possible to disable each rate-limit individually below.
- ``record_burst_limit=<limit>``
Rate limiting record burst limit. Valid Range: 0..``INT_MAX``, -1 = disabled.
- ``record_window_length=<minutes>``
Rate limiting record window length in minutes. Valid Range: 0..59.
- ``byte_burst_limit=<limit>``
Rate limiting byte burst limit. Valid Range: 0..`INT_MAX`, -1 = disabled.
- ``byte_window_length=<minutes>``
Rate limiting byte window length in minutes. Valid Range: 0..59.
- ``rate_limit_strategy=<strategy>``
Rate limit strategy - what to do with record if rate-limiting prevents
delivery over network. Valid stategies: ``spool``, ``drop``.
SEE ALSO
========
* ``telemd``\(1)
* https://github.com/clearlinux/telemetrics-client
* https://clearlinux.org/documentation/
+80 -65
View File
@@ -1,69 +1,84 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.\" Man page generated from reStructuredText.
.
.TH "TELEMETRY" "3" "December 2016" "" ""
.TH TELEMETRY 3 "" "" ""
.SH NAME
telemetry \- C programming interface for telemetrics-client
.
.SH "NAME"
\fBtelemetry\fR \- C programming interface for telemetrics\-client
.nr rst2man-indent-level 0
.
.SH "SYNOPSIS"
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH SYNOPSIS
.sp
\fB#include "telemetry.h"\fP
.sp
\fBstruct telem_ref { struct telem_record *record; };\fP
.sp
\fBint tm_create_record(struct telem_ref **t_ref, uint32_t severity, char *classification, uint32_t payload_version)\fP
.sp
\fBint tm_set_payload(struct telem_ref *t_ref, char *payload)\fP
.sp
\fBint tm_send_record(struct telem_ref *t_ref)\fP
.sp
\fBvoid tm_free_record(struct telem_ref *t_ref)\fP
.sp
\fBvoid tm_set_config_file(char *c_file)\fP
.SH DESCRIPTION
.sp
The functions in the telemetry library facilitate the delivery of
telemetry data to the \fBtelemd\fP(1) service.
.sp
The function \fBtm_create_record()\fP initializes a telemetry record and
sets the severity and classification of that record, as well as the
payload version number. The memory needed to store the telemetry record
is allocated and should be freed with \fBtm_free_record()\fP when no longer
needed.
.sp
The function \fBtm_set_payload()\fP attaches the provided telemetry record
data to the telemetry record. The current maximum payload size is 8192b.
.sp
The function \fBtm_send_record()\fP delivers the record to the local
\fBtelemd\fP(1) service.
.sp
The function \fBtm_set_config_file()\fP can be used to provide an alternate
configuration path to the telemetry library.
.SH RETURN VALUES
.sp
All these functions return \fB0\fP on success, or a non\-zero return value
if an error occurred. The functions \fBtm_free_record()\fP and \fBtm_set_config_file()\fP
do not return any values.
.SH SEE ALSO
.INDENT 0.0
.IP \(bu 2
\fBtelemd\fP(1)
.IP \(bu 2
\fI\%https://github.com/clearlinux/telemetrics\-client\fP
.IP \(bu 2
\fI\%https://clearlinux.org/documentation/\fP
.UNINDENT
.SH COPYRIGHT
(C) 2017 Intel Corporation, CC-BY-SA-3.0
.\" Generated by docutils manpage writer.
.
.nf
#include "telemetry\.h"
struct telem_ref {
struct telem_record *record;
};
int tm_create_record(struct telem_ref **t_ref, uint32_t severity,
char *classification, uint32_t payload_version)
int tm_set_payload(struct telem_ref *t_ref, char *payload)
int tm_send_record(struct telem_ref *t_ref)
void tm_free_record(struct telem_ref *t_ref)
void tm_set_config_file(char *c_file)
.
.fi
.
.SH "DESCRIPTION"
The functions in the telemetry library facilitate the delivery of telemetry data to the \fBtelemd(1)\fR service\.
.
.P
The function \fBtm_create_record()\fR initializes a telemetry record and sets the severity and classification of that record, as well as the payload version number\. The memory needed to store the telemetry record is allocated and should be freed with \fBtm_free_record()\fR when no longer needed\.
.
.P
The function \fBtm_set_payload()\fR attaches the provided telemetry record data to the telemetry record\. The current maximum payload size is 8192b\.
.
.P
The function \fBtm_send_record()\fR delivers the record to the local \fBtelemd(1)\fR service\.
.
.P
The function \fBtm_set_config_file()\fR can be used to provide an alternate configuration path to the telemetry library\.
.
.SH "RETURN VALUES"
All these functions return \fB0\fR on success, or a non\-zero return value if an error occurred\. The functions \fBtm_free_record()\fR and \fBtm_set_config_file()\fR do not return any values\.
.
.SH "COPYRIGHT"
.
.IP "\(bu" 4
Copyright (C) 2016 Intel Corporation, License: CC\-BY\-SA\-3\.0
.
.IP "" 0
.
.SH "SEE ALSO"
\fBtelemd(1)\fR
.
.P
https://github\.com/clearlinux/telemetrics\-client
.
.P
https://clearlinux\.org/documentation/
.
.SH "NOTES"
Creative Commons Attribution\-ShareAlike 3\.0 Unported
.
.IP "\(bu" 4
http://creativecommons\.org/licenses/by\-sa/3\.0/
.
.IP "" 0
-63
View File
@@ -1,63 +0,0 @@
telemetry(3) -- C programming interface for telemetrics-client
==============================================================
## SYNOPSIS
```
#include "telemetry.h"
struct telem_ref {
struct telem_record *record;
};
int tm_create_record(struct telem_ref **t_ref, uint32_t severity,
char *classification, uint32_t payload_version)
int tm_set_payload(struct telem_ref *t_ref, char *payload)
int tm_send_record(struct telem_ref *t_ref)
void tm_free_record(struct telem_ref *t_ref)
void tm_set_config_file(char *c_file)
```
## DESCRIPTION
The functions in the telemetry library facilitate the delivery of
telemetry data to the `telemd(1)` service.
The function `tm_create_record()` initializes a telemetry record and
sets the severity and classification of that record, as well as the
payload version number. The memory needed to store the telemetry record
is allocated and should be freed with `tm_free_record()` when no longer
needed.
The function `tm_set_payload()` attaches the provided telemetry record
data to the telemetry record. The current maximum payload size is 8192b.
The function `tm_send_record()` delivers the record to the local
`telemd(1)` service.
The function `tm_set_config_file()` can be used to provide an alternate
configuration path to the telemetry library.
## RETURN VALUES
All these functions return `0` on success, or a non-zero return value
if an error occurred. The functions `tm_free_record()` and `tm_set_config_file()`
do not return any values.
## COPYRIGHT
* Copyright (C) 2016 Intel Corporation, License: CC-BY-SA-3.0
## SEE ALSO
`telemd(1)`
https://github.com/clearlinux/telemetrics-client
https://clearlinux.org/documentation/
## NOTES
Creative Commons Attribution-ShareAlike 3.0 Unported
* http://creativecommons.org/licenses/by-sa/3.0/
+67
View File
@@ -0,0 +1,67 @@
=========
telemetry
=========
----------------------------------------------
C programming interface for telemetrics-client
----------------------------------------------
:Copyright: \(C) 2017 Intel Corporation, CC-BY-SA-3.0
:Manual section: 3
SYNOPSIS
========
``#include "telemetry.h"``
``struct telem_ref { struct telem_record *record; };``
``int tm_create_record(struct telem_ref **t_ref, uint32_t severity, char *classification, uint32_t payload_version)``
``int tm_set_payload(struct telem_ref *t_ref, char *payload)``
``int tm_send_record(struct telem_ref *t_ref)``
``void tm_free_record(struct telem_ref *t_ref)``
``void tm_set_config_file(char *c_file)``
DESCRIPTION
===========
The functions in the telemetry library facilitate the delivery of
telemetry data to the ``telemd``\(1) service.
The function ``tm_create_record()`` initializes a telemetry record and
sets the severity and classification of that record, as well as the
payload version number. The memory needed to store the telemetry record
is allocated and should be freed with ``tm_free_record()`` when no longer
needed.
The function ``tm_set_payload()`` attaches the provided telemetry record
data to the telemetry record. The current maximum payload size is 8192b.
The function ``tm_send_record()`` delivers the record to the local
``telemd``\(1) service.
The function ``tm_set_config_file()`` can be used to provide an alternate
configuration path to the telemetry library.
RETURN VALUES
=============
All these functions return ``0`` on success, or a non-zero return value
if an error occurred. The functions ``tm_free_record()`` and ``tm_set_config_file()``
do not return any values.
SEE ALSO
========
* ``telemd``\(1)
* https://github.com/clearlinux/telemetrics-client
* https://clearlinux.org/documentation/
+74 -25
View File
@@ -184,7 +184,7 @@ char *skip_timestamp(char *line)
return start;
}
char *skip_spaces(char *line)
char *skip_space(char *line)
{
char *start = line;
@@ -194,6 +194,16 @@ char *skip_spaces(char *line)
return start;
}
char *skip_spaces(char *line)
{
char *start = line;
while (*start && isspace(*start)) {
start++;
}
return start;
}
bool starts_with(const char *line, const char *line_end, const char *substr)
{
size_t substrlen = strlen(substr);
@@ -346,7 +356,7 @@ void parse_single_line(char *line, size_t size)
line_end = line + size;
start = skip_log_level(line);
start = skip_timestamp(start);
start = skip_spaces(start);
start = skip_space(start);
struct oops_pattern *pattern;
if (oops_msg.length == 0) {
@@ -378,13 +388,16 @@ void parse_single_line(char *line, size_t size)
} else if (strstr(start, "[ end trace")) {
end_found = true;
} else if (!in_stack_dump) {
if (starts_with(start, line_end, " [<") ||
starts_with(start, line_end, " <") || //case : <EOI> [<fff73..]
starts_with(start, line_end, "Call Trace:")) {
// This line indicates the beginning of a stack trace;
// the next line is most likely the topmost frame.
if (starts_with(start, line_end, "Call Trace:")) {
in_stack_dump = true;
}
} else if (in_stack_dump) {
if (!(starts_with(start, line_end, " [") || starts_with(start, line_end, " <")) ||
// In Linux 4.10+, the oops format changed, so we look
// for a single leading space character to indicate a
// stack frame line.
if (!(starts_with(start, line_end, " ")) ||
(strlen(start) < 8) ||
(strstr(start, "Code:") != NULL) ||
(strstr(start, "Instruction Dump::") != NULL)) {
@@ -427,9 +440,20 @@ struct stack_frame {
void stack_frame_append(struct stack_frame **head, struct stack_frame **tail, char *start)
{
/*
* Format is as :
* Format is:
*
* [<ffffffffa1002128>] do_one_initcall+0xb8/0x1e0
* [<ffffffffa118784a>] ? __vunmap+0x9a/0x100
*
* OR
*
* <IRQ> [<ffffffff816606a8>] dump_stack+0x19/0x1b
*
* OR (in 4.10+)
*
* do_one_initcall+0xb8/0x1e0
* ? __vunmap+0x9a/0x100
*
*/
struct stack_frame *frame = NULL;
@@ -438,18 +462,22 @@ void stack_frame_append(struct stack_frame **head, struct stack_frame **tail, ch
if (!start) {
return;
}
start = start + 2;
// Skip leading spaces
start = skip_spaces(start);
//case: <IRQ> [<ffffffff816606a8>] dump_stack+0x19/0x1b
if (!strncmp(start, "IRQ>", 4) || !strncmp(start, "NMI>", 4) ||
!strncmp(start, "EOI>", 4) || !strncmp(start, "<EOE>>", 6)) {
while (*start && *start != '[') {
if (!strncmp(start, "<IRQ>", 5) || !strncmp(start, "<NMI>", 5) ||
!strncmp(start, "<EOI>", 5) || !strncmp(start, "<<EOE>>", 7)) {
while (*start && !isspace(*start)) {
start++;
}
if (*start == '\0') {
if (start && *start == '\0') {
return;
}
start++;
// Skip intervening space
start = skip_spaces(start);
}
frame = malloc(sizeof(struct stack_frame));
@@ -464,21 +492,31 @@ void stack_frame_append(struct stack_frame **head, struct stack_frame **tail, ch
*tail = frame;
}
if (*start == '<') {
// Skip memory address parsing if the address is absent (as in Linux 4.10+).
if (!strncmp(start, "[", 1)) {
start++;
frame->addr = (uint64_t)strtoll(start, (char **)&start, 16);
if (*start == '<') {
start++;
frame->addr = (uint64_t)strtoll(start, (char **)&start, 16);
} else {
frame->addr = 0;
}
// Skip up to the space after the closing bracket
while (*start && !isspace(*start)) {
start++;
}
if (start && *start == '\0') {
return;
}
// Skip intervening space
start = skip_spaces(start);
} else {
frame->addr = 0;
}
/* Skip up to the space after the closing bracket */
while (*start && !isspace(*start)) {
start++;
}
if (*start) {
start++;
}
offset_ptr = strchr(start, '+');
end = offset_ptr ? offset_ptr : (start + strlen(start));
frame->function = strndup(start, (size_t)(end - start));
@@ -732,17 +770,28 @@ GString *parse_backtrace(struct oops_log_msg *msg)
GString *backtrace = NULL;
int frame_counter = 1;
char *modules = NULL, *kernel_version = NULL, *tainted = NULL;
// Since lines are processed from last to first, the stack trace lines
// will appear first.
bool in_trace = true;
for (int i = msg->length - 1; i > 0; i--) {
/* Check if this line is part of a stack trace */
line = msg->lines[i];
if (starts_with(line, line + strlen(line), " [") ||
starts_with(line, line + strlen(line), " <")) {
if (in_trace && starts_with(line, line + strlen(line), " ")) {
stack_frame_append(&head, &tail, line);
continue;
}
// We've reached the end of the stack trace
if (starts_with(line, line + strlen(line), "Call Trace:")) {
in_trace = false;
}
// Stack trace lines must be consecutive, so if this point is
// reached, we're outside the trace boundary.
in_trace = false;
if (str_starts_with_casei(line, "Modules linked in: ")) {
modules = line + strlen("Modules linked in: ");
continue;
+48
View File
@@ -623,6 +623,53 @@ START_TEST(bug_kernel_handle_payload)
}
END_TEST
START_TEST(bug_kernel_handle_payload_new_format)
{
char *oopsfile = NULL;
oopsfile = TESTOOPSDIR "/bug_kernel_handle_new.txt";
setup_payload(oopsfile);
telem_log(LOG_ERR, "Bug kernel handle backtrace: %s\n", pl->str);
ck_assert(pl->len > 0);
ck_assert_str_eq(reason, "BUG: unable to handle kernel paging request at 0000000000002658");
ck_assert(strstr(pl->str, "Kernel Version : 3.7.9-201.fc18.x86_64 #1 Apple Inc. MacBookPro6,2/Mac-F22586C8"));
ck_assert(strstr(pl->str, "Tainted : PF"));
ck_assert(strstr(pl->str, "Modules : nf_conntrack_netbios_ns nf_conntrack_broadcast ipt_MASQUERADE be2iscsi"));
ck_assert(strstr(pl->str, "drm_kms_helper firewire_ohci drm firewire_core tg3 crc_itu_t i2c_core video usb_storage sunrpc"));
ck_assert(strstr(pl->str, "#1 ? _nv007312rm"));
ck_assert(strstr(pl->str, "#2 ? _nv007847rm"));
ck_assert(strstr(pl->str, "#3 ? _nv004049rm"));
ck_assert(strstr(pl->str, "#4 ? _nv004049rm"));
ck_assert(strstr(pl->str, "#5 ? _nv010019rm"));
ck_assert(strstr(pl->str, "#6 ? _nv014983rm"));
ck_assert(strstr(pl->str, "#7 ? _nv001097rm"));
ck_assert(strstr(pl->str, "#8 ? rm_init_adapter"));
ck_assert(strstr(pl->str, "#9 nv_kern_open"));
ck_assert(strstr(pl->str, "#10 ? chrdev_open"));
ck_assert(strstr(pl->str, "#11 ? do_dentry_open"));
ck_assert(strstr(pl->str, "#12 ? cdev_put"));
ck_assert(strstr(pl->str, "#13 ? finish_open"));
ck_assert(strstr(pl->str, "#14 ? do_last"));
ck_assert(strstr(pl->str, "#15 ? inode_permission"));
ck_assert(strstr(pl->str, "#16 link_path_walk"));
ck_assert(strstr(pl->str, "#17 path_openat"));
ck_assert(strstr(pl->str, "#18 ? do_filp_open"));
ck_assert(strstr(pl->str, "#19 ? __alloc_fd"));
ck_assert(strstr(pl->str, "#20 ? do_sys_open"));
ck_assert(strstr(pl->str, "#21 ? __audit_syscall_entry"));
ck_assert(strstr(pl->str, "#22 ? sys_open"));
ck_assert(strstr(pl->str, "#23 ? system_call_fastpath"));
g_string_free(pl, true);
}
END_TEST
Suite *config_suite(void)
{
// A suite is comprised of test cases, defined below
@@ -648,6 +695,7 @@ Suite *config_suite(void)
tcase_add_test(t, double_fault_payload);
tcase_add_test(t, bad_page_map_payload);
tcase_add_test(t, bug_kernel_handle_payload);
tcase_add_test(t, bug_kernel_handle_payload_new_format);
//TODO fix
//tcase_add_test(t, badness_payload);
+1
View File
@@ -72,6 +72,7 @@ EXTRA_DIST += \
%D%/oops_test_files/badness.txt \
%D%/oops_test_files/bad_page_map.txt \
%D%/oops_test_files/bug_kernel_handle.txt \
%D%/oops_test_files/bug_kernel_handle_new.txt \
%D%/oops_test_files/double_fault_DONE.txt \
%D%/oops_test_files/double_fault.txt \
%D%/oops_test_files/general_protection_fault.txt \
@@ -0,0 +1,51 @@
<4>[ 68764.975947] BUG: unable to handle kernel paging request at 0000000000002658
<4>[ 68764.975947] IP: [<ffffffffa07f92e5>] _nv007245rm+0x54/0xc4 [nvidia]
<4>[ 68764.975947] PGD 22d005067 PUD 22d006067 PMD 0
<4>[ 68764.975947] Oops: 0000 [#1] SMP
<4>[ 68764.975947] Modules linked in: nf_conntrack_netbios_ns nf_conntrack_broadcast ipt_MASQUERADE be2iscsi iscsi_boot_sysfs bnx2i cnic uio cxgb4i cxgb4 cxgb3i cxgb3 mdio ip6table_mangle libcxgbi ib_iser rdma_cm ib_addr iw_cm ib_cm ib_sa ib_mad ib_core iscsi_tcp libiscsi_tcp ip6t_REJECT libiscsi scsi_transport_iscsi nf_conntrack_ipv6 nf_defrag_ipv6 iptable_nat nf_nat_ipv4 nf_nat iptable_mangle nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ebtable_filter ebtables rfcomm ip6table_filter ip6_tables bnep nls_utf8 hfsplus binfmt_misc snd_hda_codec_hdmi arc4 brcmsmac cordic brcmutil mac80211 cfg80211 joydev iTCO_wdt iTCO_vendor_support nvidia(POF) coretemp applesmc input_polldev microcode uvcvideo i2c_i801 intel_ips snd_hda_codec_cirrus videobuf2_vmalloc videobuf2_memops videobuf2_core videodev btusb media bluetooth snd_hda_intel snd_hda_codec rfkill snd_hwdep bcm5974 snd_seq snd_seq_device snd_pcm lpc_ich mfd_core bcma snd_page_alloc snd_timer vhost_net tun snd macvtap macvlan soundcore kvm_intel kvm apple_gmux apple_bl uinput crc32c_intel i915 ghash_clmulni_intel i2c_algo_bit drm_kms_helper firewire_ohci drm firewire_core tg3 crc_itu_t i2c_core video usb_storage sunrpc
<4>[ 68764.975947] CPU 2
<4>[ 68764.975947] Pid: 1059, comm: Xorg Tainted: PF O 3.7.9-201.fc18.x86_64 #1 Apple Inc. MacBookPro6,2/Mac-F22586C8
<4>[ 68764.975947] RIP: 0010:[<ffffffffa07f92e5>] [<ffffffffa07f92e5>] _nv007245rm+0x54/0xc4 [nvidia]
<4>[ 68764.975947] RSP: 0018:ffff88022d0639b8 EFLAGS: 00010282
<4>[ 68764.975947] RAX: 0000000000000000 RBX: ffff88022d190008 RCX: 0000000000000000
<4>[ 68764.975947] RDX: 0000000000000000 RSI: 0000000000000015 RDI: 0000000000000000
<4>[ 68764.975947] RBP: ffff88022d30df08 R08: 0000000000000002 R09: ffff88023f342508
<4>[ 68764.975947] R10: ffff88022d951030 R11: 0000000000000000 R12: 0000000000000000
<4>[ 68764.975947] R13: ffff88023f3b0008 R14: 0000000000000000 R15: ffff88022da96008
<4>[ 68764.975947] FS: 00007f771f4f2940(0000) GS:ffff88024fc80000(0000) knlGS:0000000000000000
<4>[ 68764.975947] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
<4>[ 68764.975947] CR2: 0000000000002658 CR3: 000000022d004000 CR4: 00000000000007e0
<4>[ 68764.975947] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
<4>[ 68764.975947] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
<4>[ 68764.975947] Process Xorg
<4>[ 68764.975947] Stack:
<4>[ 68764.975947] ffff88022d33a008 ffff88022d33a008 0000000000000002 ffff88023f3b0008
<4>[ 68764.975947] ffff88022d190008 ffffffffa07deec8 ffff88023d67b008 ffff88022d190008
<4>[ 68764.975947] ffff88023f3b0008 ffff88023f3b0008 ffff88022da94808 ffffffffa083e77f
<4>[ 68764.975947] Call Trace:
<4>[ 68764.975947] ? _nv007312rm+0x7f8/0x938 [nvidia]
<4>[ 68764.975947] ? _nv007847rm+0x80/0x276 [nvidia]
<4>[ 68764.975947] ? _nv004049rm+0x85fb/0xaef0 [nvidia]
<4>[ 68764.975947] ? _nv004049rm+0x705f/0xaef0 [nvidia]
<4>[ 68764.975947] ? _nv010019rm+0x25/0x40 [nvidia]
<4>[ 68764.975947] ? _nv014983rm+0x7c9/0x943 [nvidia]
<4>[ 68764.975947] ? _nv001097rm+0x42b/0x661 [nvidia]
<4>[ 68764.975947] ? rm_init_adapter+0xac/0x146 [nvidia]
<4>[ 68764.975947] nv_kern_open+0x4b4/0x800 [nvidia]
<4>[ 68764.975947] ? chrdev_open+0x9b/0x180
<4>[ 68764.975947] ? do_dentry_open+0x203/0x290
<4>[ 68764.975947] ? cdev_put+0x30/0x30
<4>[ 68764.975947] ? finish_open+0x35/0x50
<4>[ 68764.975947] ? do_last+0x6de/0xe00
<4>[ 68764.975947] ? inode_permission+0x18/0x50
<4>[ 68764.975947] link_path_walk+0x77/0x870
<4>[ 68764.975947] path_openat+0xbc/0x4d0
<4>[ 68764.975947] ? do_filp_open+0x41/0xa0
<4>[ 68764.975947] ? __alloc_fd+0x42/0x110
<4>[ 68764.975947] ? do_sys_open+0xf4/0x1e0
<4>[ 68764.975947] ? __audit_syscall_entry+0xcc/0x300
<4>[ 68764.975947] ? sys_open+0x21/0x30
<4>[ 68764.975947] ? system_call_fastpath+0x16/0x1b
<4>[ 68764.975947] Code: e0 05 00 00 00 00 00 00 41 bc 00 00 00 00 eb 18 44 89 e2 48 89 de 4c 89 ef ff 93 48 1a 00 00 01 83 e0 05 00 00 41 ff c4 4c 89 f7 <41> ff 96 58 26 00 00 44 39 e0 77 d9 ba 74 06 10 00 be 00 00 00
<4>[ 68764.975947] RIP [<ffffffffa07f92e5>] _nv007245rm+0x54/0xc4 [nvidia]
<4>[ 68764.975947] RSP <ffff88022d0639b8>