X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=lib%2Fbabeltrace.c;h=0bcfd1d231aed9f4b3ce9dfaab5dac0c71cd87ed;hp=8fe44fbf35caa842661357b50488dd2161e36103;hb=c462e188f3e7819c7bc74f671038cdbf36e8c3c0;hpb=6f3077a2db5bfeb47ed75b1c7c731a5e8e60aa43 diff --git a/lib/babeltrace.c b/lib/babeltrace.c index 8fe44fbf..0bcfd1d2 100644 --- a/lib/babeltrace.c +++ b/lib/babeltrace.c @@ -16,44 +16,23 @@ * * 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 +#include #include #include int babeltrace_verbose, babeltrace_debug; -int convert_trace(struct trace_descriptor *td_write, - struct trace_collection *trace_collection_read) -{ - struct babeltrace_iter *iter; - struct ctf_stream *stream; - struct ctf_stream_event *event; - struct ctf_text_stream_pos *sout; - struct trace_collection_pos begin_pos; - int ret = 0; - - sout = container_of(td_write, struct ctf_text_stream_pos, - trace_descriptor); - - begin_pos.type = BT_SEEK_BEGIN; - iter = babeltrace_iter_create(trace_collection_read, &begin_pos, NULL); - while (babeltrace_iter_read_event(iter, &stream, &event) == 0) { - ret = sout->parent.event_cb(&sout->parent, stream); - if (ret) { - fprintf(stdout, "[error] Writing event failed.\n"); - goto end; - } - ret = babeltrace_iter_next(iter); - if (ret < 0) - goto end; - } -end: - babeltrace_iter_destroy(iter); - return ret; -} - static void __attribute__((constructor)) init_babeltrace_lib(void) {