projects
/
ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libust: improve support for regex marker specification
[ust.git]
/
libust
/
relay.h
diff --git
a/libust/relay.h
b/libust/relay.h
index ddbb81274920835ff3dcc18077e60c5bba617140..ba536d700672af24dbf9d316f9edc7895f02147f 100644
(file)
--- a/
libust/relay.h
+++ b/
libust/relay.h
@@
-21,9
+21,11
@@
//ust// #include <linux/kref.h>
//ust// #include <linux/mm.h>
//ust// #include <linux/ltt-core.h>
//ust// #include <linux/kref.h>
//ust// #include <linux/mm.h>
//ust// #include <linux/ltt-core.h>
-#include "kref.h"
-#include "list.h"
+#include <assert.h>
+#include <kcompat/kref.h>
+//#include "list.h"
#include "channels.h"
#include "channels.h"
+#include "buffer.h"
/* Needs a _much_ better name... */
#define FIX_SIZE(x) ((((x) - 1) & PAGE_MASK) + PAGE_SIZE)
/* Needs a _much_ better name... */
#define FIX_SIZE(x) ((((x) - 1) & PAGE_MASK) + PAGE_SIZE)
@@
-213,16
+215,24
@@
static inline struct buf_page *ltt_relay_cache_page(struct rchan_buf *buf,
//ust// #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
static inline void ltt_relay_do_copy(void *dest, const void *src, size_t len)
{
//ust// #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
static inline void ltt_relay_do_copy(void *dest, const void *src, size_t len)
{
+ union {
+ const void *src;
+ const u8 *src8;
+ const u16 *src16;
+ const u32 *src32;
+ const u64 *src64;
+ } u = { .src = src };
+
switch (len) {
case 0: break;
switch (len) {
case 0: break;
- case 1: *(u8 *)dest = *
(const u8 *)src
;
+ case 1: *(u8 *)dest = *
u.src8
;
break;
break;
- case 2: *(u16 *)dest = *
(const u16 *)src
;
+ case 2: *(u16 *)dest = *
u.src16
;
break;
break;
- case 4: *(u32 *)dest = *
(const u32 *)src
;
+ case 4: *(u32 *)dest = *
u.src32
;
break;
//ust// #if (BITS_PER_LONG == 64)
break;
//ust// #if (BITS_PER_LONG == 64)
- case 8: *(u64 *)dest = *
(const u64 *)src
;
+ case 8: *(u64 *)dest = *
u.src64
;
break;
//ust// #endif
default:
break;
//ust// #endif
default:
@@
-290,13
+300,16
@@
static inline int ltt_relay_write(struct rchan_buf *buf, size_t offset,
//ust// _ltt_relay_write(buf, offset, src, len, page, pagecpy);
//ust// return len;
//ust// _ltt_relay_write(buf, offset, src, len, page, pagecpy);
//ust// return len;
-
size_t cpy;
size_t cpy;
- cpy = min_t(size_t, len, buf->buf_size - offset);
- ltt_relay_do_copy(buf->buf_data + offset, src, cpy);
+ size_t buf_offset = BUFFER_OFFSET(offset, buf->chan);
+
+ assert(buf_offset < buf->chan->subbuf_size*buf->chan->n_subbufs);
+
+ cpy = min_t(size_t, len, buf->buf_size - buf_offset);
+ ltt_relay_do_copy(buf->buf_data + buf_offset, src, cpy);
if (unlikely(len != cpy))
if (unlikely(len != cpy))
- _ltt_relay_write(buf, offset, src, len, cpy);
+ _ltt_relay_write(buf,
buf_
offset, src, len, cpy);
return len;
}
return len;
}
@@
-366,4
+379,11
@@
int ltt_do_get_subbuf(struct rchan_buf *buf, struct ltt_channel_buf_struct *ltt_
int ltt_do_put_subbuf(struct rchan_buf *buf, struct ltt_channel_buf_struct *ltt_buf, u32 uconsumed_old);
int ltt_do_put_subbuf(struct rchan_buf *buf, struct ltt_channel_buf_struct *ltt_buf, u32 uconsumed_old);
+void init_ustrelay_transport(void);
+
+/*static*/ /* inline */ notrace void ltt_commit_slot(
+ struct ltt_channel_struct *ltt_channel,
+ void **transport_data, long buf_offset,
+ size_t data_size, size_t slot_size);
+
#endif /* _LINUX_LTT_RELAY_H */
#endif /* _LINUX_LTT_RELAY_H */
This page took
0.025815 seconds
and
4
git commands to generate.