mirror of
https://github.com/clearlinux/telemetrics-client.git
synced 2026-09-01 11:15:51 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afb7572adf | ||
|
|
3337c45b08 | ||
|
|
672e741e5d | ||
|
|
e19e72a5b3 |
+1
-1
@@ -2,7 +2,7 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.69])
|
||||
AC_INIT([telemetrics-client], [2.2.0], [https://clearlinux.org/])
|
||||
AC_INIT([telemetrics-client], [2.2.1], [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])
|
||||
|
||||
@@ -89,7 +89,7 @@ Event id to use in the record. If not provided a randomly generated id will be a
|
||||
.SH SEE ALSO
|
||||
.INDENT 0.0
|
||||
.IP \(bu 2
|
||||
\fBtelemd\fP(1)
|
||||
\fBtelemprobd\fP(1)
|
||||
.IP \(bu 2
|
||||
\fI\%https://github.com/clearlinux/telemetrics\-client\fP
|
||||
.IP \(bu 2
|
||||
|
||||
@@ -76,6 +76,6 @@ RETURN VALUES
|
||||
SEE ALSO
|
||||
========
|
||||
|
||||
* ``telemd``\(1)
|
||||
* ``telemprobd``\(1)
|
||||
* https://github.com/clearlinux/telemetrics-client
|
||||
* https://clearlinux.org/documentation/
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ Checks if telemetry client daemons are active (telemprobd and telempostd).
|
||||
.SH SEE ALSO
|
||||
.INDENT 0.0
|
||||
.IP \(bu 2
|
||||
\fBtelemd\fP(1)
|
||||
\fBtelemprobd\fP(1)
|
||||
.IP \(bu 2
|
||||
\fI\%https://github.com/clearlinux/telemetrics\-client\fP
|
||||
.IP \(bu 2
|
||||
|
||||
@@ -52,6 +52,6 @@ RETURN VALUES
|
||||
SEE ALSO
|
||||
========
|
||||
|
||||
* ``telemd``\(1)
|
||||
* ``telemprobd``\(1)
|
||||
* https://github.com/clearlinux/telemetrics-client
|
||||
* https://clearlinux.org/documentation/
|
||||
|
||||
@@ -60,7 +60,7 @@ 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.
|
||||
\fBtelemprobd\fP(1) service.
|
||||
.sp
|
||||
The function \fBtm_set_config_file()\fP can be used to provide an alternate
|
||||
configuration path to the telemetry library.
|
||||
|
||||
@@ -44,7 +44,7 @@ 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.
|
||||
``telemprobd``\(1) service.
|
||||
|
||||
The function ``tm_set_config_file()`` can be used to provide an alternate
|
||||
configuration path to the telemetry library.
|
||||
|
||||
@@ -5,5 +5,11 @@ bin_PROGRAMS += \
|
||||
%D%/journal.c \
|
||||
src/util.c \
|
||||
src/common.c
|
||||
%C%_telem_journal_CFLAGS = \
|
||||
$(AM_CFLAGS)
|
||||
|
||||
if LOG_SYSTEMD
|
||||
%C%_telem_journal_CFLAGS += $(SYSTEMD_JOURNAL_CFLAGS)
|
||||
%C%_telem_journal_LDADD = $(SYSTEMD_JOURNAL_LIBS)
|
||||
endif
|
||||
# vim: filetype=automake tabstop=8 shiftwidth=8 noexpandtab
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program is part of the Clear Linux Project
|
||||
*
|
||||
* Copyright 2015 Intel Corporation
|
||||
* Copyright 2019 Intel Corporation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms and conditions of the GNU Lesser General Public License, as
|
||||
@@ -17,6 +17,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
@@ -35,7 +36,6 @@
|
||||
#include <systemd/sd-journal.h>
|
||||
#endif
|
||||
#else
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <syslog.h>
|
||||
#endif
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
#include "probe.h"
|
||||
#include "telemetry.h"
|
||||
|
||||
#define FRAMES_MAX 64
|
||||
|
||||
static Dwfl *d_core = NULL;
|
||||
|
||||
/*
|
||||
@@ -298,6 +300,12 @@ static int frame_cb(Dwfl_Frame *frame, void *userdata)
|
||||
}
|
||||
}
|
||||
nc_string_append_printf(*bt, "\n");
|
||||
|
||||
if (frame_counter >= FRAMES_MAX) {
|
||||
errorstr = NULL;
|
||||
return DWARF_CB_ABORT;
|
||||
}
|
||||
|
||||
return DWARF_CB_OK;
|
||||
}
|
||||
|
||||
@@ -390,6 +398,12 @@ static int process_corefile(nc_string **backtrace)
|
||||
*backtrace = nc_string_dup("");
|
||||
|
||||
if (dwfl_getthreads(d_core, thread_cb, backtrace) != DWARF_CB_OK) {
|
||||
/* We aborted unwinding, due to too many frames.
|
||||
* We don't consider this as an error.
|
||||
*/
|
||||
if (frame_counter >= FRAMES_MAX) {
|
||||
return 0;
|
||||
}
|
||||
/* When errors occur during the unwinding, we reach this point.
|
||||
* If an error string is set for the particular error, send an
|
||||
* "error" record to capture at least a partial backtrace if
|
||||
@@ -656,6 +670,11 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (frame_counter >= FRAMES_MAX) {
|
||||
telem_log(LOG_ERR, "Too many frames. Backtrace truncated.\n");
|
||||
nc_string_append_printf(header, "Too many frames. Backtrace truncated.\n");
|
||||
}
|
||||
|
||||
nc_string_prepend(backtrace, header->str);
|
||||
|
||||
if (!send_data(&backtrace, default_severity, clr_class)) {
|
||||
|
||||
+36
-7
@@ -9,24 +9,48 @@ bin_PROGRAMS += \
|
||||
%D%/bertprobe
|
||||
|
||||
%C%_pythonprobe_SOURCES = %D%/python-probe.c
|
||||
%C%_pythonprobe_CFLAGS = $(AM_CFLAGS)
|
||||
%C%_pythonprobe_LDADD = $(top_builddir)/src/libtelemetry.la
|
||||
%C%_pythonprobe_LDFLAGS = \
|
||||
$(AM_LDFLAGS) \
|
||||
-pie
|
||||
|
||||
if LOG_SYSTEMD
|
||||
if HAVE_SYSTEMD_JOURNAL
|
||||
%C%_pythonprobe_CFLAGS += $(SYSTEMD_JOURNAL_CFLAGS)
|
||||
%C%_pythonprobe_LDADD += $(SYSTEMD_JOURNAL_LIBS)
|
||||
endif
|
||||
endif
|
||||
|
||||
%C%_hprobe_SOURCES = %D%/hello.c
|
||||
%C%_hprobe_LDADD = $(top_builddir)/src/libtelemetry.la
|
||||
%C%_hprobe_CFLAGS = $(AM_CFLAGS)
|
||||
%C%_hprobe_LDFLAGS = \
|
||||
$(AM_LDFLAGS) \
|
||||
-pie
|
||||
|
||||
if LOG_SYSTEMD
|
||||
if HAVE_SYSTEMD_JOURNAL
|
||||
%C%_hprobe_CFLAGS += $(SYSTEMD_JOURNAL_CFLAGS)
|
||||
%C%_hprobe_LDADD += $(SYSTEMD_JOURNAL_LIBS)
|
||||
endif
|
||||
endif
|
||||
|
||||
%C%_bertprobe_SOURCES = %D%/bert_probe.c \
|
||||
src/nica/b64enc.c
|
||||
%C%_bertprobe_CFLAGS = $(AM_CFLAGS)
|
||||
%C%_bertprobe_LDADD = $(top_builddir)/src/libtelemetry.la
|
||||
%C%_bertprobe_LDFLAGS = \
|
||||
$(AM_LDFLAGS) \
|
||||
-pie
|
||||
|
||||
if LOG_SYSTEMD
|
||||
if HAVE_SYSTEMD_JOURNAL
|
||||
%C%_bertprobe_CFLAGS += $(SYSTEMD_JOURNAL_CFLAGS)
|
||||
%C%_bertprobe_LDADD += $(SYSTEMD_JOURNAL_LIBS)
|
||||
endif
|
||||
endif
|
||||
|
||||
%C%_telem_record_gen_SOURCES = %D%/telem_record_gen.c
|
||||
%C%_telem_record_gen_CFLAGS = \
|
||||
$(AM_CFLAGS)
|
||||
@@ -35,6 +59,14 @@ bin_PROGRAMS += \
|
||||
$(AM_LDFLAGS) \
|
||||
-pie
|
||||
|
||||
if LOG_SYSTEMD
|
||||
if HAVE_SYSTEMD_JOURNAL
|
||||
%C%_telem_record_gen_CFLAGS += $(SYSTEMD_JOURNAL_CFLAGS)
|
||||
%C%_telem_record_gen_LDADD += $(SYSTEMD_JOURNAL_LIBS)
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
%C%_pstoreclean_SOURCES = %D%/pstore_clean.c
|
||||
%C%_pstoreclean_CFLAGS = \
|
||||
$(AM_CFLAGS)
|
||||
@@ -113,13 +145,6 @@ endif
|
||||
-pie
|
||||
|
||||
if LOG_SYSTEMD
|
||||
if HAVE_SYSTEMD_JOURNAL
|
||||
%C%_klogscanner_CFLAGS += \
|
||||
$(SYSTEMD_JOURNAL_CFLAGS)
|
||||
%C%_klogscanner_LDADD += \
|
||||
$(SYSTEMD_JOURNAL_LIBS)
|
||||
endif
|
||||
|
||||
if HAVE_SYSTEMD_JOURNAL
|
||||
%C%_klogscanner_CFLAGS += \
|
||||
$(SYSTEMD_JOURNAL_CFLAGS)
|
||||
@@ -149,6 +174,10 @@ bin_PROGRAMS += \
|
||||
%C%_journalprobe_LDFLAGS = \
|
||||
$(AM_LDFLAGS) \
|
||||
-pie
|
||||
if LOG_SYSTEMD
|
||||
%C%_journalprobe_CFLAGS += $(SYSTEMD_JOURNAL_CFLAGS)
|
||||
%C%_journalprobe_LDADD += $(SYSTEMD_JOURNAL_LIBS)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
@@ -33,6 +33,13 @@ dist_check_SCRIPTS = \
|
||||
@CHECK_LIBS@ \
|
||||
$(top_builddir)/src/libtelem-shared.la
|
||||
|
||||
if HAVE_SYSTEMD_JOURNAL
|
||||
if LOG_SYSTEMD
|
||||
%C%_check_config_CFLAGS += $(SYSTEMD_JOURNAL_CFLAGS)
|
||||
%C%_check_config_LDADD += $(SYSTEMD_JOURNAL_LIBS)
|
||||
endif
|
||||
endif
|
||||
|
||||
%C%_check_probd_SOURCES = \
|
||||
%D%/check_probd.c \
|
||||
src/telemdaemon.c \
|
||||
@@ -180,6 +187,13 @@ EXTRA_DIST += \
|
||||
%C%_check_journal_LDADD = \
|
||||
@CHECK_LIBS@
|
||||
|
||||
if HAVE_SYSTEMD_JOURNAL
|
||||
if LOG_SYSTEMD
|
||||
%C%_check_journal_CFLAGS += $(SYSTEMD_JOURNAL_CFLAGS)
|
||||
%C%_check_journal_LDADD += $(SYSTEMD_JOURNAL_LIBS)
|
||||
endif
|
||||
endif
|
||||
|
||||
%C%_check_libtelemetry_SOURCES = \
|
||||
%D%/check_libtelemetry.c \
|
||||
src/configuration.h \
|
||||
@@ -195,4 +209,11 @@ EXTRA_DIST += \
|
||||
$(top_builddir)/src/libtelemetry.la \
|
||||
$(top_builddir)/src/libtelem-shared.la
|
||||
|
||||
if HAVE_SYSTEMD_JOURNAL
|
||||
if LOG_SYSTEMD
|
||||
%C%_check_libtelemetry_CFLAGS += $(SYSTEMD_JOURNAL_CFLAGS)
|
||||
%C%_check_libtelemetry_LDADD += $(SYSTEMD_JOURNAL_LIBS)
|
||||
endif
|
||||
endif
|
||||
|
||||
# vim: filetype=automake tabstop=8 shiftwidth=8 noexpandtab
|
||||
|
||||
Reference in New Issue
Block a user