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

Collapse All | Expand All

(-)systemtap/runtime/print.c (+35 lines)
Lines 72-77 void _stp_print_cleanup (void) Link Here
72
		free_percpu(Stp_lbuf);
72
		free_percpu(Stp_lbuf);
73
}
73
}
74
74
75
#define __DEF_EXPORT_FN(fn, postfix) fn ## _ ## postfix
76
#define DEF_EXPORT_FN(fn, postfix) __DEF_EXPORT_FN(fn, postfix)
77
78
#if defined(RELAY_GUEST)
79
#if defined(RELAY_HOST)
80
        #error "Cannot specify both RELAY_HOST and RELAY_GUEST"
81
#endif
82
#define EXPORT_FN(fn) DEF_EXPORT_FN(fn, RELAY_GUEST)
83
#elif defined(RELAY_HOST)
84
#define EXPORT_FN(fn) DEF_EXPORT_FN(fn, RELAY_HOST)
85
#else /* defined(RELAY_GUEST) || defined(RELAY_HOST) */
86
#define EXPORT_FN(fn) fn
87
#endif
88
89
#if !defined(RELAY_GUEST)
75
/* The relayfs API changed between 2.6.15 and 2.6.16. */
90
/* The relayfs API changed between 2.6.15 and 2.6.16. */
76
/* Use the appropriate print flush function. */
91
/* Use the appropriate print flush function. */
77
92
Lines 80-85 void _stp_print_cleanup (void) Link Here
80
#else
95
#else
81
#include "print_new.c"
96
#include "print_new.c"
82
#endif
97
#endif
98
#if defined(RELAY_HOST)
99
EXPORT_SYMBOL_GPL(EXPORT_FN(stp_print_flush));
100
#endif
101
102
#endif /*!RELAY_GUEST*/
103
104
#if defined(RELAY_GUEST) || defined(RELAY_HOST)
105
/* Prohibit irqs to avoid racing on a relayfs */
106
extern void EXPORT_FN(stp_print_flush) (_stp_pbuf *);
107
static inline void _stp_print_flush(void)
108
{
109
	unsigned long flags;
110
	local_irq_save(flags);
111
	EXPORT_FN(stp_print_flush) (per_cpu_ptr(Stp_pbuf, smp_processor_id()));
112
	local_irq_restore(flags);
113
}
114
#else
115
#define _stp_print_flush() \
116
	EXPORT_FN(stp_print_flush)(per_cpu_ptr(Stp_pbuf, smp_processor_id()))
117
#endif
83
118
84
#ifndef STP_MAXBINARYARGS
119
#ifndef STP_MAXBINARYARGS
85
#define STP_MAXBINARYARGS 127
120
#define STP_MAXBINARYARGS 127
(-)systemtap/runtime/print_new.c (-2 / +1 lines)
Lines 17-25 Link Here
17
 */
17
 */
18
spinlock_t _stp_print_lock = SPIN_LOCK_UNLOCKED;
18
spinlock_t _stp_print_lock = SPIN_LOCK_UNLOCKED;
19
19
20
void _stp_print_flush (void)
20
void EXPORT_FN(stp_print_flush) (_stp_pbuf *pb)
21
{
21
{
22
	_stp_pbuf *pb = per_cpu_ptr(Stp_pbuf, smp_processor_id());
23
	uint32_t len = pb->len;
22
	uint32_t len = pb->len;
24
23
25
	/* check to see if there is anything in the buffer */
24
	/* check to see if there is anything in the buffer */
(-)systemtap/runtime/print_old.c (-2 / +1 lines)
Lines 16-24 Link Here
16
 * @note Preemption must be disabled to use this.
16
 * @note Preemption must be disabled to use this.
17
 */
17
 */
18
18
19
void _stp_print_flush (void)
19
void EXPORT_FN(stp_print_flush) (_stp_pbuf *pb)
20
{
20
{
21
	_stp_pbuf *pb = per_cpu_ptr(Stp_pbuf, smp_processor_id());
22
	uint32_t len = pb->len;
21
	uint32_t len = pb->len;
23
22
24
	/* check to see if there is anything in the buffer */
23
	/* check to see if there is anything in the buffer */
(-)systemtap/runtime/transport/transport.c (+6 lines)
Lines 225-230 int _stp_transport_init(void) Link Here
225
	_stp_uid = current->uid;
225
	_stp_uid = current->uid;
226
	_stp_gid = current->gid;
226
	_stp_gid = current->gid;
227
227
228
#ifdef RELAY_GUEST
229
        /* Guest scripts use relay only for reporting warnings and errors */
230
        _stp_subbuf_size = 65536;
231
        _stp_nsubbufs = 2;
232
#endif
233
228
	if (_stp_bufsize) {
234
	if (_stp_bufsize) {
229
		unsigned size = _stp_bufsize * 1024 * 1024;
235
		unsigned size = _stp_bufsize * 1024 * 1024;
230
		_stp_subbuf_size = ((size >> 2) + 1) * 65536;
236
		_stp_subbuf_size = ((size >> 2) + 1) * 65536;

Return to bug 3858