memcpy should copy the null terminator too. The code as it is works
because the destination has null terminators, but we should not relly on
those. We should copy the str and it's null termination.
Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
This change updates the project's license file to ensure it is detectable
by GitHub, enhancing its visibility on the project landing page.
Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
- Use latest version of checkout action.
- Checkout the head of the PR commit.
- Install json-c dependency.
- Use libcheck from OS.
Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
- tm_set_payload: check payload for NULL value before duplication, this
is desirable due the use of strnlen and strndup.
- tm_set_payload: replace strlen with strnlen to use MAX_PAYLOAD_LENGTH
during function call instead of checking after the fact.
Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
Updating the HTTP API from v2 to v3 to support JSON message
encapsulation instead of custom HTTP headers with a single-field POST
field for the payload.
Increase the version to 2.3.5 to release fix for missing records in
journal and preempt klogscanner service start inside containers.
Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
This change fixes the condition when the first record after telempostd
starts is not inserted in the telemetry journal.
Notice! there is a change in the logic, while previously records
where inserted to juornal as soon the record was processed. After this
change records will be inserted in the journal only when successfully
delivered or record_server_delivery_enabled is set to false.
Increase the version to 2.3.4 to release CI configuration changes,
memory leaks fixes, and crash probe frame counter fix.
Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
process_corefile may be called twice due to retry logic.
Make sure frame_counter is initialized each time.
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
The function "concatargs" allocated a buffer for concatenated strings
that was 1 byte short of needed, not accounting for the terminating
NULL char.
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Increase the version to 2.3.2 to reflect the fact that
bertprobe was entirely removed. The bertprobe functionality
was moved to klogscanner.
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Payloads can exceed MAX_PAYLOAD_SIZE, in which case the probe
will fail to send any data to the backend server. This was observed
with BERT payloads, but other payload types can exceed the maximum
size as well.
This patch truncates the payload if needed. It is better to receive
a truncated report than none.
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
New Linux kernels detect/interpret/display BERT errors in klog.
This makes bertprobe unnecessary, as all the information can
be simply grabbed from klog. This also removes the need to
encode the binary data into HEX/ASCII, so all the encoding
code can be removed as well, including the test suite.
The change was implemented by adding a new pattern for BERT
in the oops_parser.c with some additional minor changes.
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Fix a reported problem: https://github.com/clearlinux/telemetrics-client/issues/170
This patch fixes the case when there is no error reported via BERT data
and yet the probe fails with error such as:
"Failed to read payload from: /sys/firmware/acpi/tables/data/BERT"
Which then results in journalprobe reporting:
"bert-probe.service: Main process exited, code=exited, status=1/FAILURE"
The file BERT data file now has root only read permissions:
$ ls -al /sys/firmware/acpi/tables/data/BERT
-r-------- 1 root root 32768 Nov 25 07:37 /sys/firmware/acpi/tables/data/BERT
Hence the user "telemetry" cannot read it anymore. In addition, the file size
can be more than max payload size (4k). However, the file can be completely
blank. The probe inspects the block_status for any present errors.
If there aren't any, probe does not report anything.
While in there, for consistency reasons, modified "printf" statements with
error messages to telem_log(LOG_ERR, msg)
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Not all commands need to be run as root.
In particular "is-active".
While in there, some minor formatting fixes.
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
telemetrics-client installation starts when the package is installed,
this change makes sure that to start telemetry the first time two steps
are needed: 1- telemctl opt-in and 2- telemctl start
Signed-off-by: Alex Jaramillo <alex.jch@gmail.com>
Remove all references to python probe. The python exceptions
are handled entirely in Python code. This telemetrics-client
package does not need to be aware of the Python code exception handling
and does not need to make any provisions for it (such as creating
services and directories).
It is the responsibility of Python exception handling to properly
interface with the telemetry library.
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Add support for ramoops files in pstore probe, get the crash information
from "/sys/fs/pstore/dmesg-ramoops-x" files.
Add the "-f" cmd option support to input runtime config file when
running the probe.
Change-Id: Id7f26d6e07a7c215027b9be039356b2633d4869f
Signed-off-by: Tian Baofeng <baofeng.tian@intel.com>