#define STP_PRINT_BUF_START (STP_TIMESTAMP_SIZE)
-#ifndef STP_PRINT_BUF_LEN
-#define STP_PRINT_BUF_LEN 8192
-#endif
typedef struct __stp_pbuf {
uint32_t len; /* bytes used in the buffer */
char timestamp[STP_TIMESTAMP_SIZE];
- char buf[STP_PRINT_BUF_LEN];
+ char buf[STP_BUFFER_SIZE];
} _stp_pbuf;
void *Stp_pbuf = NULL;
static void * _stp_reserve_bytes (int numbytes)
{
_stp_pbuf *pb = per_cpu_ptr(Stp_pbuf, smp_processor_id());
- int size = STP_PRINT_BUF_LEN - pb->len;
+ int size = STP_BUFFER_SIZE - pb->len;
void * ret;
- if (unlikely(numbytes == 0 || numbytes > STP_PRINT_BUF_LEN))
+ if (unlikely(numbytes == 0 || numbytes > STP_BUFFER_SIZE))
return NULL;
if (numbytes > size)
if (str == _stp_stdout) {
_stp_pbuf *pb = per_cpu_ptr(Stp_pbuf, smp_processor_id());
char *buf = pb->buf + pb->len;
- int size = STP_PRINT_BUF_LEN - pb->len;
+ int size = STP_BUFFER_SIZE - pb->len;
va_start(args, fmt);
num = _stp_vsnprintf(buf, size, fmt, args);
va_end(args);
if (pb->len == 0) {
/* A single print request exceeded the buffer size. */
/* Should not be possible with Systemtap-generated code. */
- pb->len = STP_PRINT_BUF_LEN;
+ pb->len = STP_BUFFER_SIZE;
_stp_print_flush();
num = 0;
} else {
/* try again */
va_start(args, fmt);
- num = _stp_vsnprintf(pb->buf, STP_PRINT_BUF_LEN, fmt, args);
+ num = _stp_vsnprintf(pb->buf, STP_BUFFER_SIZE, fmt, args);
va_end(args);
}
}
if (str == _stp_stdout) {
_stp_pbuf *pb = per_cpu_ptr(Stp_pbuf, smp_processor_id());
char *buf = pb->buf + pb->len;
- int size = STP_PRINT_BUF_LEN - pb->len;
+ int size = STP_BUFFER_SIZE - pb->len;
num = _stp_vsnprintf(buf, size, fmt, args);
if (unlikely(num > size)) {
/* overflowed the buffer */
if (pb->len == 0) {
/* A single print request exceeded the buffer size. */
/* Should not be possible with Systemtap-generated code. */
- pb->len = STP_PRINT_BUF_LEN;
+ pb->len = STP_BUFFER_SIZE;
_stp_print_flush();
num = 0;
} else {
_stp_print_flush();
/* try again */
- num = _stp_vsnprintf(pb->buf, STP_PRINT_BUF_LEN, fmt, args);
+ num = _stp_vsnprintf(pb->buf, STP_BUFFER_SIZE, fmt, args);
}
}
pb->len += num;
int num = strlen (str2);
if (str1 == _stp_stdout) {
_stp_pbuf *pb = per_cpu_ptr(Stp_pbuf, smp_processor_id());
- int size = STP_PRINT_BUF_LEN - pb->len;
+ int size = STP_BUFFER_SIZE - pb->len;
if (num > size) {
_stp_print_flush();
- if (num > STP_PRINT_BUF_LEN)
- num = STP_PRINT_BUF_LEN;
+ if (num > STP_BUFFER_SIZE)
+ num = STP_BUFFER_SIZE;
}
memcpy (pb->buf + pb->len, str2, num);
pb->len += num;
{
if (str1 == _stp_stdout) {
_stp_pbuf *pb = per_cpu_ptr(Stp_pbuf, smp_processor_id());
- int size = STP_PRINT_BUF_LEN - pb->len;
+ int size = STP_BUFFER_SIZE - pb->len;
char *buf;
if (1 >= size)