#include "libsigrok.h"
#include "libsigrok-internal.h"
+#define LOG_PREFIX "backend"
+
extern struct sr_session *session;
/**
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "device: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "device"
/**
* @file
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "filter: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "filter"
/**
* @file
#ifndef LIBSIGROK_HARDWARE_AGILENT_DMM_AGILENT_DMM_H
#define LIBSIGROK_HARDWARE_AGILENT_DMM_AGILENT_DMM_H
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "agilent-dmm: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "agilent-dmm"
#define AGDMM_BUFSIZE 256
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "alsa: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "alsa"
/** Private, per-device-instance driver context. */
struct dev_context {
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "appa-55ii: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "appa-55ii"
#define APPA_55II_NUM_PROBES 2
#define APPA_55II_BUF_SIZE (4 + 32 + 1)
#ifndef LIBSIGROK_HARDWARE_ASIX_SIGMA_ASIX_SIGMA_H
#define LIBSIGROK_HARDWARE_ASIX_SIGMA_ASIX_SIGMA_H
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "asix-sigma: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "asix-sigma"
enum sigma_write_register {
WRITE_CLOCK_SELECT = 0,
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "brymen-dmm: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "brymen-dmm"
#define DMM_BUFSIZE 256
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "cem-dt-885x: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "cem-dt-885x"
/* When retrieving samples from device memory, group this many
* together into a sigrok packet. */
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "center-3xx: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "center-3xx"
/* Note: When adding entries here, don't forget to update CENTER_DEV_COUNT. */
enum {
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "la8: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "la8"
#define USB_VENDOR_ID 0x0403
#define USB_DESCRIPTION "ChronoVu LA8"
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "colead-slm: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "colead-slm"
enum {
IDLE,
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "es51922: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "es51922"
/* Factors for the respective measurement mode (0 means "invalid"). */
static const float factors[8][8] = {
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "es519xx: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "es519xx"
/* Factors for the respective measurement mode (0 means "invalid"). */
static const float factors_2400_11b[8][8] = {
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "fs9721: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "fs9721"
static int parse_digit(uint8_t b)
{
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "fs9922: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "fs9922"
static gboolean flags_valid(const struct fs9922_info *info)
{
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "bbcgm-m2110: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
-
SR_PRIV gboolean sr_m2110_packet_valid(const uint8_t *buf)
{
float val;
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "metex14: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "metex14"
static int parse_value(const uint8_t *buf, float *result)
{
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "rs9lcd: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "rs91lcd"
/* Byte 1 of the packet, and the modes it represents */
#define IND1_HZ (1 << 7)
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "ezusb: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "ezusb"
SR_PRIV int ezusb_reset(struct libusb_device_handle *hdl, int set_clear)
{
#include <glib.h>
#include <string.h>
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "scpi: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "scpi"
#define SCPI_READ_RETRIES 100
#define SCPI_READ_RETRY_TIMEOUT 10000
#include <glib.h>
#include <string.h>
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "scpi_serial: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "scpi_serial"
#define SCPI_READ_RETRIES 100
#define SCPI_READ_RETRY_TIMEOUT 10000
#endif
#include <errno.h>
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "scpi_tcp: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "scpi_tcp"
struct scpi_tcp {
char *address;
#include <fcntl.h>
#include <errno.h>
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "scpi_usbtmc: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "scpi_usbtmc"
SR_PRIV int scpi_usbtmc_open(void *priv)
{
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "serial: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "serial"
/**
* Open the specified serial port.
#define SUBCLASS_USBTMC 0x03
#define USBTMC_USB488 0x01
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "usb: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "usb"
/**
* Find USB devices according to a connection string.
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "demo: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "demo"
/* TODO: Number of probes should be configurable. */
#define NUM_PROBES 8
#ifndef LIBSIGROK_HARDWARE_FLUKE_DMM_FLUKE_DMM_H
#define LIBSIGROK_HARDWARE_FLUKE_DMM_FLUKE_DMM_H
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "fluke-dmm: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "fluke-dmm"
#define FLUKEDMM_BUFSIZE 256
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "fx2lafw: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "fx2lafw"
#define USB_INTERFACE 0
#define USB_CONFIGURATION 1
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "gmc-mh-1x-2x: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "gmc-mh-1x-2x"
#define GMC_BUFSIZE 266
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "hameg-hmo: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "hameg-hmo"
#define MAX_INSTRUMENT_VERSIONS 10
#define MAX_COMMAND_SIZE 31
#ifndef LIBSIGROK_HARDWARE_HANTEK_DSO_DSO_H
#define LIBSIGROK_HARDWARE_HANTEK_DSO_DSO_H
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "hantek-dso: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "hantek-dso"
#define USB_INTERFACE 0
#define USB_CONFIGURATION 1
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "ikalogic-scanalogic2: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "ikalogic-scanalogic2"
#define VENDOR_NAME "IKALOGIC"
#define MODEL_NAME "Scanalogic-2"
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "scanaplus: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "scanaplus"
#define COMPRESSED_BUF_SIZE (64 * 1024)
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "kecheng-kc-330b: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "kecheng-kc-330b"
#define EP_IN 0x80 | 1
#define EP_OUT 2
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "lascar-el-usb: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "lascar-el-usb"
#define LASCAR_VENDOR "Lascar"
#define LASCAR_INTERFACE 0
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "mso19: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "mso19"
#define USB_VENDOR "3195"
#define USB_PRODUCT "f190"
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "mic-985xx: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "mic-985xx"
/* Note: When adding entries here, don't forget to update MIC_DEV_COUNT. */
enum {
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "norma-dmm: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "norma-dmm"
#define NMADMM_BUFSIZE 256
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "ols: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "ols"
#define NUM_PROBES 32
#define NUM_TRIGGER_STAGES 4
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "rigol-ds: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "rigol-ds"
#define DS1000_ANALOG_LIVE_WAVEFORM_SIZE 600
#define DS2000_ANALOG_LIVE_WAVEFORM_SIZE 1400
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "saleae-logic16: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "saleae-logic16"
enum voltage_range {
VOLTAGE_RANGE_UNKNOWN,
#ifndef LIBSIGROK_HARDWARE_SERIAL_DMM_PROTOCOL_H
#define LIBSIGROK_HARDWARE_SERIAL_DMM_PROTOCOL_H
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "serial-dmm: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "serial-dmm"
/* Note: When adding entries here, don't forget to update DMM_COUNT. */
enum {
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "teleinfo: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "teleinfo"
enum optarif {
OPTARIF_NONE,
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "tondaj-sl-814: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "tondaj-sl-814"
/** Private, per-device-instance driver context. */
struct dev_context {
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "uni-t-dmm: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "uni-t-dmm"
enum {
TECPEL_DMM_8061,
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "uni-t-ut32x: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "uni-t-ut32x"
#define DEFAULT_DATA_SOURCE DATA_SOURCE_LIVE
#define USB_CONN "1a86.e008"
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "victor-dmm: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "victor-dmm"
#define DMM_DATA_SIZE 14
#include "libsigrok-internal.h"
#include "analyzer.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "zeroplus: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "zeroplus"
/* Private, per-device-instance driver context. */
struct dev_context {
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "hwdriver: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "hwdriver"
/**
* @file
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "input/binary: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "input/binary"
#define CHUNKSIZE (512 * 1024)
#define DEFAULT_NUM_PROBES 8
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "input/chronovu-la8: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "input/chronovu-l8"
#define NUM_PACKETS 2048
#define PACKET_SIZE 4096
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "input/csv: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "input/csv"
/*
* The CSV input module has the following options:
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "input/vcd: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "input/vcd"
#define DEFAULT_NUM_PROBES 8
#define CHUNKSIZE 1024
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "input/wav: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "input/wav"
#define CHUNK_SIZE 4096
SR_PRIV int sr_warn(const char *format, ...);
SR_PRIV int sr_err(const char *format, ...);
+/* Message logging helpers with subsystem-specific prefix string. */
+#ifndef NO_LOG_WRAPPERS
+#define sr_log(l, s, args...) sr_log(l, "%s: " s, LOG_PREFIX, ## args)
+#define sr_spew(s, args...) sr_spew("%s: " s, LOG_PREFIX, ## args)
+#define sr_dbg(s, args...) sr_dbg("%s: " s, LOG_PREFIX, ## args)
+#define sr_info(s, args...) sr_info("%s: " s, LOG_PREFIX, ## args)
+#define sr_warn(s, args...) sr_warn("%s: " s, LOG_PREFIX, ## args)
+#define sr_err(s, args...) sr_err("%s: " s, LOG_PREFIX, ## args)
+#endif
+
/*--- device.c --------------------------------------------------------------*/
SR_PRIV struct sr_probe *sr_probe_new(int index, int type,
#include <stdarg.h>
#include <stdio.h>
#include "libsigrok.h"
+#define NO_LOG_WRAPPERS
#include "libsigrok-internal.h"
/**
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "output/analog: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "output/analog"
struct context {
int num_enabled_probes;
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "output/binary: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "output/binary:"
static int data(struct sr_output *o, const uint8_t *data_in,
uint64_t length_in, uint8_t **data_out, uint64_t *length_out)
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "output/chronovu-la8: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "output/chronovu-la8"
struct context {
unsigned int num_enabled_probes;
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "output/csv: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "output/csv"
struct context {
unsigned int num_enabled_probes;
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "output/gnuplot: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "output/gnuplot"
struct context {
unsigned int num_enabled_probes;
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "output/ols: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "output/ols"
struct context {
uint64_t samplerate;
#include "libsigrok-internal.h"
#include "text.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "output/ascii: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "output/ascii"
SR_PRIV int init_ascii(struct sr_output *o)
{
#include "libsigrok-internal.h"
#include "text.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "output/bits: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "output/bits"
SR_PRIV int init_bits(struct sr_output *o)
{
#include "libsigrok-internal.h"
#include "text.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "output/hex: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "output/hex"
SR_PRIV int init_hex(struct sr_output *o)
{
#include "libsigrok-internal.h"
#include "text.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "output/text: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "output/text"
SR_PRIV void flush_linebufs(struct context *ctx, uint8_t *outbuf)
{
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "output/vcd: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "output/vcd"
struct context {
int num_enabled_probes;
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "session: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "session"
/**
* @file
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "virtual-session: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "virtual-session"
/* size of payloads sent across the session bus */
/** @cond PRIVATE */
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "session-file: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "session-file"
/**
* @file
#include "libsigrok.h"
#include "libsigrok-internal.h"
+#define LOG_PREFIX "std"
+
/**
* Standard sr_driver_init() API helper.
*
#include "libsigrok.h"
#include "libsigrok-internal.h"
-/* Message logging helpers with subsystem-specific prefix string. */
-#define LOG_PREFIX "strutil: "
-#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args)
-#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args)
-#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args)
-#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args)
-#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args)
-#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args)
+#define LOG_PREFIX "strutil"
/**
* @file