babeltrace与CTF相关学习笔记-2

ops/2024/12/15 4:11:13/

这里写自定义目录标题

  • 写在前面
  • 前面的小结
  • bt_ctf_writer_create

写在前面

事情正在朝着不可控的方向狂奔。。。
系统工师师,其实只有一个任务:将复杂的系统简单化;将乱成一团的分工,明确化;降低每个人面对的复杂度。归根到底系统工程师要处理的是复杂度:简化复杂度。与庖丁解牛类似。
但现在的情况,是正在向北极狂奔。尽管我马快,车夫好,但我现在唯一担心的,不是去不去楚国的问题,而是身上的衣服能不能度过北极的问题。
本来,我们根本不需要研究nanolog的,我们只需自己划格子。有人出了格,我们能用证据说明:你出格了。我们的任务就完成了。但我们现在要解析nanolog,不是向少,而是向多。
我们只能听天命尽人事了。

前面的小结

我们的目标是找到meta,然后将nanolog的meta,转为ctf的meta.
前面,我们找到了babeltrace库。
但是,这个库,我们看到的是如何处理数据,没有看到meta相关的信息。
要么,我们没有分析透这个例程,要么,还有别的例程与meta相关。
两个方面,我们都要研究。下面开始吧。

bt_ctf_writer_create

进入核心库后,第一句,我们就看到了这一句:
在这里插入图片描述
metadata_path = g_build_filename(path, “metadata”, NULL);
是什么意思。
今天我决定果奔了,走到哪算哪。
好像是凭空创建了一个新的meta文件,这也许是好消息,也许相反。
在这里插入图片描述然后,进入模拟trace的过程:
在这里插入图片描述
发现meta文件生成后被删除了。
所以,清空tmp后,重新来过。
在这里插入图片描述在这里插入图片描述
meta生成,但为空。
这可能说明,这个示例,主要是数据。可能与meta关系不大。
谢天谢地,在这句,有了变化:
在这里插入图片描述在这里插入图片描述
虽然说,方向的选择不一定正确,但看到了希望。
这句的意思,可能是清空这些文件,在这之前,将它们下载到本。
在这里插入图片描述
似乎这里就已经晚了,
有些内容已变少了:
在这里插入图片描述重走后发现是这句,bt_ctf_object_put_ref(stream_class);
进行merge的。

下面是metadata的内容

/* CTF 1.8 */trace {major = 1;minor = 8;uuid = "0388149e-6e6d-45bf-a65c-cca377dbe0d3";byte_order = be;packet.header := struct {integer { size = 32; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; } magic;integer { size = 8; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; } uuid[16];integer { size = 32; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; } stream_id;integer { size = 22; align = 1; signed = false; encoding = none; base = decimal; byte_order = native; } custom_trace_packet_header_field;} align(8);
};env {host = "testhost";test_env_int = 654321;test_env_str = "oh yeah";sysname = "GNU/Linux";nodename = "testhost";release = "4.4.0-87-generic";version = "#110-Ubuntu SMP Tue Jul 18 12:55:35 UTC 2017";machine = "x86_64";new_field = "test";
};clock {name = test_clock;uuid = "e2234c8a-3fb4-47db-bbac-e0ea774b9034";description = "This is a test clock";freq = 1123456789;precision = 10;offset_s = 13515309;offset = 1234567;absolute = true;
};stream {id = 123;event.header := struct {integer { size = 32; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; } id;integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; map = clock.test_clock.value; } timestamp;} align(8);packet.context := struct {integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; map = clock.test_clock.value; } timestamp_begin;integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; map = clock.test_clock.value; } timestamp_end;integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; } content_size;integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; } packet_size;integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; } events_discarded;integer { size = 5; align = 1; signed = false; encoding = none; base = decimal; byte_order = native; } custom_packet_context_field;} align(8);event.context := struct {integer { size = 32; align = 1; signed = false; encoding = none; base = decimal; byte_order = native; } common_event_context;} align(1);
};event {name = "Simple Event";id = 13;stream_id = 123;context := struct {integer { size = 12; align = 1; signed = false; encoding = none; base = decimal; byte_order = native; } event_specific_context;} align(1);fields := struct {enum : integer { size = 64; align = 1; signed = true; encoding = none; base = decimal; byte_order = native; } { "another entry" = -42000 ... -13000, "negative_value" = -12345 ... 0, "something" = -500 ... -400, "escaping; \"test\"" = 1, "\tanother 'escaping'\n test\"" = 2 ... 4, "_event clock int float" = 5 ... 22, "truie" = 42, "truie" = 43 ... 51 } enum_field;enum : integer { size = 12; align = 1; signed = false; encoding = none; base = decimal; byte_order = native; } { "escaping; \"test\"" = 0, "\tanother 'escaping'\n test\"" = 1 ... 4, "_event clock int float" = 5 ... 22, "something" = 7 ... 8, "truie" = 42, "truie" = 43 ... 51 } enum_field_unsigned;integer { size = 12; align = 1; signed = false; encoding = none; base = decimal; byte_order = native; } integer_field;floating_point { exp_dig = 11; mant_dig = 53; byte_order = native; align = 32; } float_field;} align(32);
};event {name = "Spammy_Event";id = 0;stream_id = 123;fields := struct {integer { size = 17; align = 1; signed = false; encoding = none; base = decimal; byte_order = native; } field_1;string { encoding = UTF8; } a_string;} align(8);
};event {name = "Complex Test Event";id = 42;stream_id = 123;loglevel = 6;fields := struct {integer { size = 35; align = 1; signed = false; encoding = none; base = hexadecimal; byte_order = native; } uint_35;integer { size = 16; align = 32; signed = true; encoding = none; base = decimal; byte_order = native; } int_16;struct {enum : integer { size = 3; align = 1; signed = false; encoding = none; base = decimal; byte_order = native; } { "UINT3_TYPE" = 0, "INT16_TYPE" = 1, "UINT35_TYPE" = 2 ... 7 } variant_selector;string { encoding = UTF8; } _string;variant < variant_selector> {integer { size = 3; align = 1; signed = false; encoding = none; base = decimal; byte_order = native; } UINT3_TYPE;integer { size = 16; align = 32; signed = true; encoding = none; base = decimal; byte_order = native; } INT16_TYPE;integer { size = 35; align = 1; signed = false; encoding = none; base = hexadecimal; byte_order = native; } UINT35_TYPE;} variant_value;struct {integer { size = 35; align = 1; signed = false; encoding = none; base = hexadecimal; byte_order = native; } seq_len;integer { size = 16; align = 32; signed = true; encoding = none; base = decimal; byte_order = native; } a_sequence[ seq_len];integer { size = 16; align = 32; signed = true; encoding = none; base = decimal; byte_order = native; } an_array[5];} align(32) inner_structure;} align(32) complex_structure;} align(32);
};event {name = "Simple Event";id = 1;stream_id = 123;fields := struct {} align(1);
};stream {id = 0;event.header := struct {integer { size = 32; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; } id;integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; map = clock.test_clock.value; } timestamp;} align(8);packet.context := struct {integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; map = clock.test_clock.value; } timestamp_begin;integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; map = clock.test_clock.value; } timestamp_end;integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; } content_size;integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; } packet_size;integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; } events_discarded;} align(8);
};event {name = "some_event_class_name";id = 0;stream_id = 0;fields := struct {integer { size = 32; align = 1; signed = false; encoding = none; base = decimal; byte_order = native; } integer_field;} align(1);
};stream {id = 1;};stream {id = 2;event.header := struct {integer { size = 32; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; } id;integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; map = clock.test_clock.value; } timestamp;integer { size = 13; align = 1; signed = false; encoding = none; base = decimal; byte_order = native; } seq_len;} align(8);packet.context := struct {integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; map = clock.test_clock.value; } timestamp_begin;integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; map = clock.test_clock.value; } timestamp_end;integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; } content_size;integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; } packet_size;integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = native; } events_discarded;} align(8);
};event {name = "sequence_event";id = 0;stream_id = 2;fields := struct {integer { size = 13; align = 1; signed = false; encoding = none; base = decimal; byte_order = native; } some_sequence[ stream.event.header.seq_len];} align(1);
};

已经可以用compass 打开
在这里插入图片描述虽然 没有CPUid,可以看了


http://www.ppmy.cn/ops/141998.html

相关文章

【报错记录】Ubuntu22.04解决开机卡在 /dev/sda5 : clean , *files , *blocks

一个愿意伫立在巨人肩膀上的农民...... 一、错误现象 本人的电脑安装Windows10和Ubuntu22.04双系统&#xff0c;一次训练中电脑死机无法开机&#xff0c;重启之后便出现如下错误&#xff0c;在网上寻找过很多方法均无效&#xff0c;在root下禁用了samba服务&#xff0c;也无济…

SQL中为什么EXISTS可以替代DISTINCT

引言 在SQL查询中&#xff0c;有时候我们需要从数据中获取唯一的值。传统的做法是使用DISTINCT关键字来去除重复行。然而&#xff0c;在处理大规模数据集时&#xff0c;DISTINCT可能会带来性能问题。本文将探讨为什么在某些情况下&#xff0c;EXISTS可以替代DISTINCT来提高查询…

深入探索 jQuery:解锁前端开发的高效工具

深入探索 jQuery&#xff1a;解锁前端开发的高效工具 在现代Web开发中&#xff0c;jQuery无疑是一个不可或缺的工具。它简化了HTML文档遍历、事件处理、动画和Ajax交互等任务&#xff0c;使得开发者能够更专注于逻辑和用户体验的实现。本文将详细介绍一些常用的jQuery方法&…

Scala中隐式值、隐式转换和例题

//隐式值 object jdfslfjiepo {//函数默认参数//函数默认参数值&#xff1a;小花def sayName(implicit name: String "小花"): Unit {println(s"我叫&#xff1a; $name")}//需求&#xff1a;更改函数参数的默认值(不传入这个值的时候&#xff0c;用到的…

Android 车载虚拟化底层技术-Kernel 5.15 -Android13(multi-cards)技术实现

系列文章请扫点击如下链接&#xff01; Android Display Graphics系列文章-汇总 本文主要包括部分&#xff1a; 一、Android13的Kernel 5.15版本 1.1 Kernel 5.15 情况说明 1.2 前置条件 二、QCM61*5 plane配置 2.1 multi-card配置 2.2 移植msm-lease 2.3 配置信息确认…

OpenCV 图像变换与处理实战

OpenCV快速通关 第一章&#xff1a;OpenCV 简介与环境搭建 第二章&#xff1a;OpenCV 图像基本操作 第三章&#xff1a;OpenCV 图像变换与处理实战 OpenCV 图像变换与处理实战 OpenCV快速通关OpenCV 图像变换与处理实战一、OpenCV 基础与图像处理概览二、图像变换理论精析三、…

K8S 部署 Nacos:构建云原生服务管理基石

K8S 部署 Nacos&#xff1a;构建云原生服务管理基石 一、引言 在当今云原生应用蓬勃发展的时代&#xff0c;Kubernetes&#xff08;K8S&#xff09;已成为容器编排的事实标准&#xff0c;而 Nacos 作为一款强大的服务发现与配置管理中心&#xff0c;二者的结合为构建高效、可…

LightningChart JS助力德国医疗设备商打造高精度肺功能诊断软件

项目背景&#xff1a; GANSHORN Medizin Electronic GmbH公司在德国开发、生产和销售肺功能诊断设备已有 40 多年历史&#xff0c;该公司专注于肺功能的可视化&#xff0c;其创新医疗技术通过开发先进的肺量测定测试、肺扩散分析和人体肺量测定测试解决方案取得了突破。GANSHO…