summaryrefslogtreecommitdiffstats
path: root/runtime/print_new.c
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-05-14 14:35:48 -0400
committerFrank Ch. Eigler <fche@elastic.org>2008-05-14 14:35:48 -0400
commit0fe2b97c7b967d833b5588dbf1ef763bb4440ed3 (patch)
treefcce9345c9ebacb7d5bc1f510f155bfdcea08dc4 /runtime/print_new.c
parenta007b4068d20af2d4488d54bf3ef2edbf47f2f06 (diff)
parentc3799d720b60bd74a60de4addcd0d77a90f7842a (diff)
downloadsystemtap-steved-0fe2b97c7b967d833b5588dbf1ef763bb4440ed3.tar.gz
systemtap-steved-0fe2b97c7b967d833b5588dbf1ef763bb4440ed3.tar.xz
systemtap-steved-0fe2b97c7b967d833b5588dbf1ef763bb4440ed3.zip
Merge commit 'origin/master' into pr6429-comp-unwindsyms
* commit 'origin/master': PR 5955 - Accept ; terminated globals Factored returnval() out of returnstr(), for use in dwarfless probing. Converted more aliases to use arg numbers instead of names. In particular, Revert "PR6487: extend blacklist with relay/timer subsystem" Add syscalls_by_pid.meta, syscalls_by_proc.meta, PR6487: extend blacklist with relay/timer subsystem Adjust iotime.meta description. * iotime.meta: New. Fix for PR 6500. Update ChangeLog * sleeptime.meta, wait4time.meta: New. systemtap.examples futexes.meta change futex.stp to futexes.stp. In ioblock.stp ioblock.end set bytes_done depending on kernel version. PR6492: make listing mode warning-free PR5648: Fix unaligned access warning in stp_print_flush on ia64 PR5648: Fix memcpy's endianess issue. futexes.meta, nettop.meta, pf2.meta: New. Clean up output.
Diffstat (limited to 'runtime/print_new.c')
-rw-r--r--runtime/print_new.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/runtime/print_new.c b/runtime/print_new.c
index 75bbd82b..07af2e33 100644
--- a/runtime/print_new.c
+++ b/runtime/print_new.c
@@ -40,11 +40,13 @@ void EXPORT_FN(stp_print_flush) (_stp_pbuf *pb)
else
atomic_inc (&_stp_transport_failures);
#else
- struct _stp_trace *t = relay_reserve(_stp_utt->rchan, sizeof(*t) + len);
- if (likely(t)) {
- t->sequence = _stp_seq_inc();
- t->pdu_len = len;
- memcpy((void *) t + sizeof(*t), pb->buf, len);
+ void *buf = relay_reserve(_stp_utt->rchan,
+ sizeof(struct _stp_trace) + len);
+ if (likely(buf)) {
+ struct _stp_trace t = { .sequence = _stp_seq_inc(),
+ .pdu_len = len};
+ memcpy(buf, &t, sizeof(t)); // prevent unaligned access
+ memcpy(buf + sizeof(t), pb->buf, len);
} else
atomic_inc (&_stp_transport_failures);
#endif