X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=include%2Fbabeltrace%2Fctf-text%2Ftypes.h;h=7b4b7171e733176b54536816e0a9ee1f8b06423b;hp=7703e7b8e25148272f5c6ed91f8e0264ea0d4706;hb=f3985ab106d89d8e764c1a8dd0c8bda09b755d10;hpb=81dee1bb528a95f7bf2bc622948807150794a75e diff --git a/include/babeltrace/ctf-text/types.h b/include/babeltrace/ctf-text/types.h index 7703e7b8..7b4b7171 100644 --- a/include/babeltrace/ctf-text/types.h +++ b/include/babeltrace/ctf-text/types.h @@ -17,6 +17,14 @@ * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ #include @@ -24,26 +32,29 @@ #include #include #include -#include +#include #include #include +#include /* - * Inherit from both struct stream_pos and struct trace_descriptor. + * Inherit from both struct bt_stream_pos and struct bt_trace_descriptor. */ struct ctf_text_stream_pos { - struct stream_pos parent; - struct trace_descriptor trace_descriptor; + struct bt_stream_pos parent; + struct bt_trace_descriptor trace_descriptor; FILE *fp; /* File pointer. NULL if unset. */ int depth; int dummy; /* disable output */ int print_names; /* print field names */ int field_nr; + uint64_t last_real_timestamp; /* to print delta */ + uint64_t last_cycles_timestamp; /* to print delta */ GString *string; /* Current string */ }; static inline -struct ctf_text_stream_pos *ctf_text_pos(struct stream_pos *pos) +struct ctf_text_stream_pos *ctf_text_pos(struct bt_stream_pos *pos) { return container_of(pos, struct ctf_text_stream_pos, parent); } @@ -51,14 +62,22 @@ struct ctf_text_stream_pos *ctf_text_pos(struct stream_pos *pos) /* * Write only is supported for now. */ -int ctf_text_integer_write(struct stream_pos *pos, struct definition *definition); -int ctf_text_float_write(struct stream_pos *pos, struct definition *definition); -int ctf_text_string_write(struct stream_pos *pos, struct definition *definition); -int ctf_text_enum_write(struct stream_pos *pos, struct definition *definition); -int ctf_text_struct_write(struct stream_pos *pos, struct definition *definition); -int ctf_text_variant_write(struct stream_pos *pos, struct definition *definition); -int ctf_text_array_write(struct stream_pos *pos, struct definition *definition); -int ctf_text_sequence_write(struct stream_pos *pos, struct definition *definition); +BT_HIDDEN +int ctf_text_integer_write(struct bt_stream_pos *pos, struct bt_definition *definition); +BT_HIDDEN +int ctf_text_float_write(struct bt_stream_pos *pos, struct bt_definition *definition); +BT_HIDDEN +int ctf_text_string_write(struct bt_stream_pos *pos, struct bt_definition *definition); +BT_HIDDEN +int ctf_text_enum_write(struct bt_stream_pos *pos, struct bt_definition *definition); +BT_HIDDEN +int ctf_text_struct_write(struct bt_stream_pos *pos, struct bt_definition *definition); +BT_HIDDEN +int ctf_text_variant_write(struct bt_stream_pos *pos, struct bt_definition *definition); +BT_HIDDEN +int ctf_text_array_write(struct bt_stream_pos *pos, struct bt_definition *definition); +BT_HIDDEN +int ctf_text_sequence_write(struct bt_stream_pos *pos, struct bt_definition *definition); static inline void print_pos_tabs(struct ctf_text_stream_pos *pos) @@ -69,4 +88,10 @@ void print_pos_tabs(struct ctf_text_stream_pos *pos) fprintf(pos->fp, "\t"); } +/* + * Check if the field must be printed. + */ +BT_HIDDEN +int print_field(struct bt_definition *definition); + #endif /* _BABELTRACE_CTF_TEXT_TYPES_H */