View | Details | Raw Unified | Return to bug 3858 | Differences between
and this patch

Collapse All | Expand All

(-)systemtap.orig/runtime/print.c (-4 / +21 lines)
Lines 81-86 void _stp_print_cleanup (void) Link Here
81
		free_percpu(Stp_lbuf);
81
		free_percpu(Stp_lbuf);
82
}
82
}
83
83
84
#ifdef RELAY_GUEST
85
extern void _stp_print_flush (void);
86
extern void * _stp_reserve_bytes (int numbytes);
87
extern void _stp_print_binary (int num, ...);
88
extern void _stp_printf (const char *fmt, ...);
89
extern void _stp_print (const char *str);
90
extern void _stp_print_char (const char c);
91
#else
92
84
/** Send the print buffer to the transport now.
93
/** Send the print buffer to the transport now.
85
 * Output accumulates in the print buffer until it
94
 * Output accumulates in the print buffer until it
86
 * is filled, or this is called. This MUST be called before returning
95
 * is filled, or this is called. This MUST be called before returning
Lines 121-127 void _stp_print_flush (void) Link Here
121
 */
130
 */
122
131
123
#if defined STP_RELAYFS && !defined STP_RELAYFS_MERGE
132
#if defined STP_RELAYFS && !defined STP_RELAYFS_MERGE
124
static void * _stp_reserve_bytes (int numbytes)
133
void * _stp_reserve_bytes (int numbytes)
125
{
134
{
126
	if (unlikely(numbytes == 0))
135
	if (unlikely(numbytes == 0))
127
		return NULL;
136
		return NULL;
Lines 129-135 static void * _stp_reserve_bytes (int nu Link Here
129
	return relay_reserve(_stp_chan, numbytes);
138
	return relay_reserve(_stp_chan, numbytes);
130
}
139
}
131
#else
140
#else
132
static void * _stp_reserve_bytes (int numbytes)
141
void * _stp_reserve_bytes (int numbytes)
133
{
142
{
134
	_stp_pbuf *pb = per_cpu_ptr(Stp_pbuf, smp_processor_id());
143
	_stp_pbuf *pb = per_cpu_ptr(Stp_pbuf, smp_processor_id());
135
	int size = STP_BUFFER_SIZE - pb->len;
144
	int size = STP_BUFFER_SIZE - pb->len;
Lines 153-159 static void * _stp_reserve_bytes (int nu Link Here
153
 * than doing the same in _stp_vsnprintf().
162
 * than doing the same in _stp_vsnprintf().
154
 * @sa _stp_vsnprintf()
163
 * @sa _stp_vsnprintf()
155
 */
164
 */
156
static void _stp_print_binary (int num, ...)
165
void _stp_print_binary (int num, ...)
157
{
166
{
158
	va_list vargs;
167
	va_list vargs;
159
	int i;
168
	int i;
Lines 239-245 void _stp_print_char (const char c) Link Here
239
	pb->buf[pb->len] = c;
248
	pb->buf[pb->len] = c;
240
	pb->len ++;
249
	pb->len ++;
241
}
250
}
242
251
#ifdef RELAY_HOST
252
EXPORT_SYMBOL_GPL(_stp_print_flush);
253
EXPORT_SYMBOL_GPL(_stp_reserve_bytes);
254
EXPORT_SYMBOL_GPL(_stp_print_binary);
255
EXPORT_SYMBOL_GPL(_stp_printf);
256
EXPORT_SYMBOL_GPL(_stp_print);
257
EXPORT_SYMBOL_GPL(_stp_print_char);
258
#endif /* RELAY_HOST */
259
#endif /* RELAY_GUEST */
243
260
244
/* This function is used when printing maps or stats. */
261
/* This function is used when printing maps or stats. */
245
/* Probably belongs elsewhere, but is here for now. */
262
/* Probably belongs elsewhere, but is here for now. */

Return to bug 3858