/* * Trace sequences are used to allow a function to call several other functions * to create a string of data to use. * * Have the trace seq to be 8K which is typically PAGE_SIZE * 2 on * most architectures. The TRACE_SEQ_BUFFER_SIZE (which is * TRACE_SEQ_SIZE minus the other fields of trace_seq), is the * max size the output of a trace event may be.
*/
/** * trace_seq_used - amount of actual data written to buffer * @s: trace sequence descriptor * * Returns the amount of data written to the buffer. * * IMPORTANT! * * Use this instead of @s->seq.len if you need to pass the amount * of data from the buffer to another buffer (userspace, or what not). * The @s->seq.len on overflow is bigger than the buffer size and * using it can cause access to undefined memory.
*/ staticinlineint trace_seq_used(struct trace_seq *s)
{ return seq_buf_used(&s->seq);
}
/** * trace_seq_buffer_ptr - return pointer to next location in buffer * @s: trace sequence descriptor * * Returns the pointer to the buffer where the next write to * the buffer will happen. This is useful to save the location * that is about to be written to and then return the result * of that write.
*/ staticinlinechar *
trace_seq_buffer_ptr(struct trace_seq *s)
{ return s->buffer + seq_buf_used(&s->seq);
}
/** * trace_seq_has_overflowed - return true if the trace_seq took too much * @s: trace sequence descriptor * * Returns true if too much data was added to the trace_seq and it is * now full and will not take anymore.
*/ staticinlinebool trace_seq_has_overflowed(struct trace_seq *s)
{ return s->full || seq_buf_has_overflowed(&s->seq);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.