diff --git a/ide/src/base-ui/select/LitSelectV.ts b/ide/src/base-ui/select/LitSelectV.ts index 76a89ce8fcf6206485ee9cb47ef0f3f52370c488..dc032a0738a2adaa9c8a64647a771c34a5d92529 100644 --- a/ide/src/base-ui/select/LitSelectV.ts +++ b/ide/src/base-ui/select/LitSelectV.ts @@ -303,23 +303,6 @@ export class LitSelectV extends BaseElement { } initOptions() { - this.selectVOptions!.addEventListener('click', (ev) => { - let items = this.selectVInputEl!.value.split(','); - this.customItem = []; - items.forEach((item: string) => { - if (item.trim() != '') { - let indexItem = this.itemValue.indexOf(item.trim()); - if (indexItem == -1) { - this.customItem.push(item.trim()); - } - } - }); - if (this.customItem.length > 0) { - this.selectVInputEl.value = this.customItem.concat(this.showItems); - } else { - this.selectVInputEl.value = this.showItems; - } - }); this.shadowRoot?.querySelectorAll('lit-select-option').forEach((a) => { a.setAttribute('check', ''); a.addEventListener('onSelected', (e: any) => { @@ -329,7 +312,6 @@ export class LitSelectV extends BaseElement { this.showItems.splice(number, 1); } a.removeAttribute('selected'); - return; } else { let index = this.itemValue.indexOf(a.textContent!); if (index > -1) { @@ -337,6 +319,21 @@ export class LitSelectV extends BaseElement { } a.setAttribute('selected', ''); } + let items = this.selectVInputEl!.value.split(','); + this.customItem = []; + items.forEach((item: string) => { + if (item.trim() != '') { + let indexItem = this.itemValue.indexOf(item.trim()); + if (indexItem == -1) { + this.customItem.push(item.trim()); + } + } + }); + if (this.customItem.length > 0) { + this.selectVInputEl.value = this.customItem.concat(this.showItems); + } else { + this.selectVInputEl.value = this.showItems; + } }); }); } diff --git a/ide/src/trace/component/SpWelcomePage.ts b/ide/src/trace/component/SpWelcomePage.ts index ec4ce087b0d1a44d1596cad2bce23739f6094e7d..59d9e29a342c59e0c9e15ab1b7e7bdcf25f86a06 100644 --- a/ide/src/trace/component/SpWelcomePage.ts +++ b/ide/src/trace/component/SpWelcomePage.ts @@ -30,22 +30,11 @@ export class SpWelcomePage extends BaseElement { align-content: center; background: var(--dark-background5,#F6F6F6); } - .home-page{ - margin-top: -100px; - } .lit-icon{ - margin-top: 50px; - margin-left: 50px; content: var(--dark-img,url('img/pic.png')); }
-
-

黄区域名: https://smartperf.rnd.huawei.com/smartperf/

-

绿区域名: https://devecotesting.rnd.huawei.com/smartperf/

-

3ms社区: http://3ms.huawei.com/km/groups/3956611/home?|=zh-cn

-

welink讨论群: 群1: 593524364461277889 群2: 473395703(已满) 群3: 485625665(已满)

-
`; diff --git a/ide/src/trace/component/trace/base/Utils.ts b/ide/src/trace/component/trace/base/Utils.ts index 06e44d443b42438c1184c0a0044ae793342a99c9..d4346f9f4f2738dda8639ce73618977db1fbb520 100644 --- a/ide/src/trace/component/trace/base/Utils.ts +++ b/ide/src/trace/component/trace/base/Utils.ts @@ -43,7 +43,7 @@ export class Utils { Utils.statusMap.set('R', 'Runnable'); Utils.statusMap.set('Running', 'Running'); Utils.statusMap.set('R+', 'Runnable (Preempted)'); - Utils.statusMap.set('R-B', 'Runnable (Binder)') + Utils.statusMap.set('R-B', 'Runnable (Binder)'); Utils.statusMap.set('I', 'Task Dead'); Utils.statusMap.set('T', 'Traced'); Utils.statusMap.set('t', 'Traced'); diff --git a/ide/src/trace/component/trace/timer-shaft/RangeRuler.ts b/ide/src/trace/component/trace/timer-shaft/RangeRuler.ts index 38f454b9f10aa03816655302885f5bf4264ed447..48447d67ef4027664b497ce82b0a8d4b00bc1088 100644 --- a/ide/src/trace/component/trace/timer-shaft/RangeRuler.ts +++ b/ide/src/trace/component/trace/timer-shaft/RangeRuler.ts @@ -955,10 +955,10 @@ export class RangeRuler extends Graph { count2++; } } - if (count2 >= 10) { - return; - } if (totalX <= FIT_TOTALX_MIN) { + if (count2 >= 10) { + return; + } this.pressFrameIdW = requestAnimationFrame(animW); this.fillX(); this.range.refresh = true; diff --git a/trace_streamer/.gitignore b/trace_streamer/.gitignore index d07e5f300eca5ad850f805e71c655af607e8ef2f..b185167f55da99f9237a1c89efd1e77b93ab0c71 100755 --- a/trace_streamer/.gitignore +++ b/trace_streamer/.gitignore @@ -17,3 +17,4 @@ out.perf perf.data out.floded ./.db +.history \ No newline at end of file diff --git a/trace_streamer/BUILD.gn b/trace_streamer/BUILD.gn index 2ef422c519ed4959c08447953484ab992d5f3c4b..58094a4215e4dc8c22e1882a3c9e573b11d4424c 100644 --- a/trace_streamer/BUILD.gn +++ b/trace_streamer/BUILD.gn @@ -39,10 +39,14 @@ group("trace_streamer") { if (!is_independent_compile) { group("trace_streamer_all") { - deps = [ - "src:trace_streamer(//build/toolchain/linux:clang_x64)", - "src:trace_streamer(//build/toolchain/mingw:mingw_x86_64)", - "src:trace_streamer(//build/toolchain/ohos:ohos_clang_arm64)", - ] + if (host_os == "mac") { + deps = [ "src:trace_streamer(//build/toolchain/mac:clang_arm64)" ] + } else { + deps = [ + "src:trace_streamer(//build/toolchain/linux:clang_x64)", + "src:trace_streamer(//build/toolchain/mingw:mingw_x86_64)", + "src:trace_streamer(//build/toolchain/ohos:ohos_clang_arm64)", + ] + } } } diff --git a/trace_streamer/build/protoc.sh b/trace_streamer/build/protoc.sh index 63e8971cdc12eb752e7b6bdc34f4bb7cee36df32..7191cbd4a3d9d464ade75017f49e3c61f5d1ca5b 100755 --- a/trace_streamer/build/protoc.sh +++ b/trace_streamer/build/protoc.sh @@ -26,6 +26,7 @@ OHOS_X64_OUT=$PROJECT_TOP/$2/ LIBCXX_X64_OUT=$PROJECT_TOP/$1/ndk/libcxx/linux_x86_64 SUBSYS_X64_OUT=$PROJECT_TOP/$2/$TAIL_DIR +PROTOC_DIR=$PROJECT_TOP/$2/$TAIL_DIR PROTOC=$PROJECT_TOP/$2/$TAIL_DIR/protoc OPT_PLUGIN_PROTOREADER_PATH=$PROJECT_TOP/$2/$SUBSYS_DIR/protoreader_plugin OPT_PLUGIN_PROTOREADER="--plugin=protoc-gen-plugin=$PROJECT_TOP/$2/$SUBSYS_DIR/protoreader_plugin --plugin_out=wrapper_namespace=ProtoReader" @@ -35,6 +36,13 @@ PYTHON_SHELL=$THIS_DIR/make_standard_proto.py # shell path TMP=$2 PROTO_OUT_DIR="$PROJECT_TOP/${TMP%/*}/$3" # path of the new proto file +echo "PROTOC_DIR = $PROTOC_DIR" +if ls "$PROTOC_DIR"/*.dylib 1>/dev/null 2>&1; then + cp $PROTOC_DIR/*.dylib $PROJECT_TOP/$2/$SUBSYS_DIR/ +else + echo "*.dylib Not Found!" +fi + echo "1 = $1" echo "2 = $2" echo "3 = $3" diff --git a/trace_streamer/build/ts.gni b/trace_streamer/build/ts.gni index 81bd060f8d0fa1196bf7519087590c5f668f9c58..30464b2318082f08bab002a623a8df0b7bfdefcc 100755 --- a/trace_streamer/build/ts.gni +++ b/trace_streamer/build/ts.gni @@ -28,7 +28,6 @@ if (is_independent_compile) { PERF_DIR = "//developtools" with_ebpf_help_table = false clang_x64_folder = "clang_x64" - is_macx = false is_test = false is_protoc = false is_spb = false diff --git a/trace_streamer/doc/des_tables.md b/trace_streamer/doc/des_tables.md index ae2564b05610af3a767d357eb929bac4ac6281dd..79d9d4f1199777ca99cc95f7028629495045c1ca 100755 --- a/trace_streamer/doc/des_tables.md +++ b/trace_streamer/doc/des_tables.md @@ -15,21 +15,27 @@ TraceStreamer可以将trace数据源转化为易于理解和使用的数据库 | ---- |---- | | animation | 记录动效的响应时延和完成时延| | app_name | 记录HiSysEvent事件的事件名与IDE部分事件的字段名为APPNAME中存放的相关信息的映射关系| +| app_startup | 记录了应用启动相关数据| | args | 记录方法参数集合| | bio_latency_sample | 记录IO操作相关方法调用,及调用栈数据| | callstack | 记录调用堆栈和异步调用信息,其中depth,stack_id和parent_stack_id仅在非异步调用中有效。当cookid不为空时,为异步调用,此时callid为进程唯一号,否则为线程唯一号| | clk_event_filter | 记录时钟相关的信息| | clock_event_filter | 此结构用来维护时钟事件,cpu与唯一的ID做关联| +| clock_snapshot | 时钟号和时间,时钟名的映射表| | cpu_measure_filter | cpu事件过滤器表| | cpu_usage | 记录CPU使用率事件| +| datasource_clockid | 数据源和时钟号的映射表| | data_dict | 记录常用的字符串,将字符串和索引关联,降低程序运行的内存占用,用作辅助数据| +| data_type | 记录数据类型和typeId的关联关系| | device_info | 记录设备分辨率和帧率| | device_state | 记录设备屏幕亮度,蓝牙,位置,wifi,音乐,媒体等信息| -| dynamic_frame | 记录动效帧的分辨率和结束时间等| -| data_type | 记录数据类型和typeId的关联关系| | diskio | 记录磁盘读写数据事件| +| dynamic_frame | 记录动效帧的分辨率和结束时间等| | ebpf_callstack | 记录了采样相关信息| -| file_system_samp | 记录了调用栈的相关信息| +| file_system_sample | 记录了调用栈的相关信息| +| frame_maps | 记录应用到RS的帧的映射关系| +| frame_slice | 记录RS(RenderService)和应用的帧渲染| +| gpu_slice | 记录RS的帧对应的gpu渲染时长| | hidump | 记录FPS(Frame Per Second)数据| | hisys_event_measure | 记录了HiSysEvent事件相关数据,目前HiSysEvent事件包括了异常事件,IDE事件,器件状态事件 | | instant | 记录Sched_waking, sched_wakeup事件, 用作ThreadState表的上下文使用 | @@ -46,11 +52,14 @@ TraceStreamer可以将trace数据源转化为易于理解和使用的数据库 | js_heap_string | 记录了js内存数据中的字符串| | js_heap_trace_function_info | 记录了timeline模式下的调用栈的每个函数信息| | js_heap_trace_node | 记录了timeline模式下的调用栈信息| -| app_startup | 记录了应用启动相关数据| -| static_initalize | 记录了so初始化相关数据| | live_process | 记录了一些实时的进程中执行的一些数据| | log | 记录hilog打印日志数据| +| measure | 记录所有的计量值| | measure_filter | 记录一个递增的filterid队列,所有其他的filter类型在获取过程中,均从此数据列表中获取下一个可用的filter_id并做记录| +| memory_ashmem | 记录了进程所占用的ashmem相关信息| +| memory_dma | 记录了进程占用的DMA内存相关信息| +| memory_process_gpu | 记录进程占用GPU内存相关信息| +| memory_window_gpu | 记录窗口占用GPU内存相关信息| | meta | 记录执行解析操作相关的基本信息| | native_hook | 记录堆内存申请与释放相关的数据| | native_hook_frame | 记录堆内存申请与释放相关的调用栈| @@ -70,24 +79,24 @@ TraceStreamer可以将trace数据源转化为易于理解和使用的数据库 | sched_slice | 此数据结构主要作为ThreadState的上下文使用,这张表是sched_switch事件的原始记录| | smaps | 记录进程的内存消耗的相关信息采样| | stat | 此结果用来统计数据解析中各类数据的数据条数,数据和合法性,数据的匹配程度(begin-end),数据的损失等,查看此结构对应的表,可对数据源有基本的了解| +| static_initalize | 记录了so初始化相关数据| | symbols | 记录系统调用名称和其函数指针的对应关系,trace中用addr来映射function_name来节省存储空间| | syscall | 记录用户空间函数与内核空间函数相互调用记录| | sys_event_filter | 记录所有的filter| | sys_mem_measure | 记录了所有的系统内存相关的测量信息| +| task_pool | 记录任务池相关数据,与callstack表相关联| | thread | 记录所有的线程信息| | thread_filter | 过滤线程| | thread_state | 记录线程状态信息| | trace_config | 记录trace数据源,proto的事件-plugin与其process_name| | trace_range | 记录ftrace数据与其他类型数据的时间交集,供前端展示数据时使用| -| clock_snapshot | 时钟号和时间,时钟名的映射表| -| datasource_clockid | 数据源和时钟号的映射表| -| task_pool | 记录任务池相关数据,与callstack表相关联| ## 表与事件来源 | 表名称 | 事件源 | 插件名 | 备注 | | ---- | ---- | ---- | ---- | -|animation | - |ftrace-plugin |记录动效的响应时延和完成时延 | +|animation | - |ftrace-plugin |记录动效的响应时延和完成时延 | |app_name | - |hisysevent-plugin |JSON数据源 | |args | - |ftrace-plugin |配合callstack使用 | +|bio_latency_sample | - | - |IO操作相关方法调用,及调用栈数据 | |callstack | - |ftrace-plugin |异步或非异步的调用 | |cpu_measure_filter | - |ftrace-plugin |cpu跟踪器,cpu频率等 | |cpu_usage | - |cpu-plugin |cpu使用率 | @@ -95,12 +104,13 @@ TraceStreamer可以将trace数据源转化为易于理解和使用的数据库 |data_type | 通用的 | - |辅助表 | |device_info | - |ftrace-plugin |记录设备分辨率和帧率 | |device_state | 通用的 |hisysevent-plugin |记录设备屏幕亮度,蓝牙,位置等信息 | -|dynamic_frame | - |ftrace-plugin |记录动效帧的分辨率和结束时间等 | +|dynamic_frame | - |ftrace-plugin |动效帧的分辨率和结束时间等 | +|ebpf_callstack | - | - |磁盘读写相关的数据 | |file_system_callstack | - | - |ebpf文件系统 | |file_system_sample | - | - |ebpf文件系统 | -|frame_maps | - |ftrace-plugin |帧渲染数据,app到RS的映射 | -|frame_slice | - |ftrace-plugin |帧渲染数据 | -|gpu_slice | - |ftrace-plugin |gpu渲染时长 | +|frame_maps | - |ftrace-plugin |帧渲染数据,app到RS的映射 | +|frame_slice | - |ftrace-plugin |帧渲染数据 | +|gpu_slice | - |ftrace-plugin |gpu渲染时长 | |hidump | - |hidump-plugin |FPS数据 | |hisys_event_measure | - |hisysevent-plugin |JSON数据源 | |instant | - |ftrace-plugin |waking和wakeup事件 | @@ -117,18 +127,23 @@ TraceStreamer可以将trace数据源转化为易于理解和使用的数据库 |js_heap_string | - |arkts-plugin | js内存数据 | |js_heap_trace_function_info | - |arkts-plugin | js内存数据 | |js_heap_trace_node | - |arkts-plugin | js内存数据 | -|app_startup | - |ftrace-plugin | 应用启动数据 | -|static_initalize | - |ftrace-plugin | so初始化数据 | +|app_startup | - |ftrace-plugin | 应用启动数据 | +|static_initalize | - |ftrace-plugin | so初始化数据 | |live_process | - |process-plugin |Monitor数据 | |network | - |network-plugin |Monitor数据 | |diskio | - |diskio-plugin |Monitor数据 | |log | - |hilog-plugin |系统日志 | |measure | 通用的 | - |系统中的计量值(数值型)| |measure_filter | 通用的 | - |计量值的查询辅助表 | +|memory_ashmem | - |memory-plugin |进程所占用ashmem相关信息 | +|memory_dma | - |memory-plugin |进程占用的DMA内存相关信息 | +|memory_process_gpu | - |memory-plugin |进程占用GPU内存相关信息 | +|memory_window_gpu | - |memory-plugin |窗口占用GPU内存相关信息 | |meta | 通用的 | - |记录解析现场数据(解析时间,数据类型,解析工具等)| |native_hook | - |nativehook/hookdaemon |malloc && mmap内存数据 | |native_hook_frame | - |nativehook/hookdaemon |native_hook调用栈数据 | |native_hook_statistic | - |nativehook/hookdaemon |malloc && mmap统计数据 | +|paged_memory_sample | - | - |网络数据传输相关的信息 | |perf_callchain | - |perf-plugin |perf数据(非插件模式) | |perf_files | - | - |perf数据(非插件模式) | |perf_report | - | - |perf数据(非插件模式) | @@ -151,8 +166,8 @@ TraceStreamer可以将trace数据源转化为易于理解和使用的数据库 |trace_config | 通用的 |hisysevent-plugin |记录trace数据源 | |trace_range | 通用的 | - |trace数据的时长 | |thread_filter | 通用的 |ftrace-plugin |线程计量跟踪表(比较少用)| -|clock_snapshot | 通用的 |通用的 |时钟号和时间,时钟名的映射表| -|datasource_clockid | 通用的 |通用的 |数据源和时钟号的映射表| +|clock_snapshot | 通用的 |通用的 |时钟号和时间,时钟名的映射表| +|datasource_clockid | 通用的 |通用的 |数据源和时钟号的映射表| |task_pool | - | - |任务池数据 | ## ___表格关系图___ @@ -472,7 +487,7 @@ js_heap_sample:记录timeline的时间轴信息 #### 表描述 记录了与磁盘读写相关的数据。 #### 主要字段描述 -- callchain_id:调用栈的唯一标识。与ebpf_callstack表中Callchain_id字段关联 +- callchain_id:调用栈的唯一标识 - depth:调用栈深度。取值为零时表示栈顶 - ip:调用栈ip - symbols_id:调用栈函数名称, 与data_dict中的id字段关联 @@ -1569,7 +1584,7 @@ js_heap_sample:记录timeline的时间轴信息 - src:该帧是被哪一帧(该表中对应的行数)触发的,有多个值时,用逗号分割 - dst:该帧对应的渲染帧是哪一行 - type: 0 说明该行数据是实际渲染帧, 1 说明该行数据是期望渲染帧 -- flag: 空时,为不完整的数据;0 表示实际渲染帧不卡帧, 1 表示实际渲染帧卡帧, 2 表示数据不需要绘制(没有frameNum信息) +- flag: 空时,为不完整的数据;0 表示实际渲染帧不卡帧, 1 表示实际渲染帧卡帧(expectEndTime < actualEndTime为异常), 2 表示数据不需要绘制(没有frameNum信息),3 表示rs进程与app进程起止异常(|expRsStartTime - expUiEndTime| < 1ms 正常,否则异常。这里使用期待帧的时间差做判断,给实际帧打标签) - depth:预留 - frame_no:预留 @@ -1750,4 +1765,131 @@ js_heap_sample:记录timeline的时间轴信息 #### 关键字段描述 - trace_source:事件源 - key:事件需要关注的信息名 -- value:事件需要关注的信息名对应的信息值 \ No newline at end of file +- value:事件需要关注的信息名对应的信息值 + +### memory_ashmem表 +#### 表结构 +| Columns Name | SQL TYPE | +|---- |---- | +|id |INT | +|ts |INT | +|ipid |INT | +|adj |INT | +|fd |INT | +|ashmem_name_id|INT | +|size |INT | +|pss |INT | +|ashmem_id |INT | +|time |INT | +|ref_count |INT | +|purged |INT | +|flag |INT | +#### 表描述 +该表记录trace数据源,proto的事件-plugin与其process_name(目前只有HisysEvent事件在用)。 +#### 关键字段描述 +- ts:时间戳 +- ipid:内部进程号 +- fd:共享内存文件描述符 +- ashmem_name_id:共享内存名 +- size:共享内存大小 +- pss:PSS内存大小 +- ashmem_id:共享内存ID +- ref_count:引用计数 +- flag:去重标记,0表示正常,1表示进程内部重复数据,2表示进程间重复数据 + +### memory_dma表 +#### 表结构 +| Columns Name | SQL TYPE | +|---- |---- | +|id |INT | +|ts |INT | +|ipid |INT | +|fd |INT | +|size |INT | +|ino |INT | +|exp_pid |INT | +|exp_task_comm_id|INT | +|buf_name_id |INT | +|exp_name_id |INT | +|flag |INT | +#### 表描述 +该表记录trace数据源,proto的事件-plugin与其process_name(目前只有HisysEvent事件在用)。 +#### 关键字段描述 +- ts:时间戳 +- ipid:内部进程号 +- fd:dma内存文件描述符 +- size:dma内存大小 +- exp_pid:申请者的进程号 +- buf_name_id:dma内存名 +- exp_name_id:申请者进程名 +- flag:去重标记,0表示正常,1表示进程内部重复数据,2表示进程间重复数据 + +### memory_process_gpu表 +#### 表结构 +| Columns Name | SQL TYPE | +|---- |---- | +|id |INT | +|ts |INT | +|gpu_name_id |INT | +|all_gpu_size |INT | +|addr |TEXT | +|ipid |INT | +|itid |INT | +|used_gpu_size |INT | +#### 表描述 +该表记录trace数据源,proto的事件-plugin与其process_name(目前只有HisysEvent事件在用)。 +#### 关键字段描述 +- ts:时间戳 +- gpu_name_id:gpu内存名称 +- all_gpu_size:进程占用gpu总大小 +- addr:gpu内存地址 +- ipid:内部进程号 +- itid:内部线程号 +- used_gpu_size:已使用的gpu大小 + +### memory_window_gpu表 +#### 表结构 +| Columns Name | SQL TYPE | +|---- |---- | +|id |INT | +|ts |INT | +|window_name_id|INT | +|window_id |INT | +|module_name_id|INT | +|category_name_id|INT | +|size |INT | +|count |INT | +|purgeable_size|INT | +#### 表描述 +该表记录trace数据源,proto的事件-plugin与其process_name(目前只有HisysEvent事件在用)。 +#### 关键字段描述 +- ts:时间戳 +- window_name_id:窗口名 +- window_id:窗口id +- module_name_id:模块名 +- category_name_id:目录名 +- size:内存大小 +- count:内存申请个数 + +### static_initalize表 +#### 表结构 +| Columns Name | SQL TYPE | +|---- |---- | +|id |INT | +|ipid |INT | +|tid |INT | +|call_id |INT | +|start_time |INT | +|end_time |INT | +|so_name |TEXT | +|depth |INT | +#### 表描述 +该表记录了so初始化相关数据。 +#### 关键字段描述 +- ipid:内部进程号 +- tid:内部线程号 +- call_id:调用者的ID,对应线程表里面的itid +- start_time:阶段开始时间 +- end_time:阶段结束时间 +- so_name:so文件名称 +- depth:泳道图的深度 \ No newline at end of file diff --git a/trace_streamer/format-code.sh b/trace_streamer/format-code.sh index 67e49d2b3605d493b900478c7f0e1a445d373f0e..8e86f549ca7b40930a0677384b24e93802658242 100755 --- a/trace_streamer/format-code.sh +++ b/trace_streamer/format-code.sh @@ -25,8 +25,11 @@ esac PRJ_ROOT_DIR=$(readlink -f -- "$(dirname $0)/") cd ${PRJ_ROOT_DIR} FORMAT_DIR_LIST=( - "${PRJ_ROOT_DIR}/src" + "${PRJ_ROOT_DIR}/build" + "${PRJ_ROOT_DIR}/gn" + "${PRJ_ROOT_DIR}/prebuilts" "${PRJ_ROOT_DIR}/sdk" + "${PRJ_ROOT_DIR}/src" "${PRJ_ROOT_DIR}/test" ) echo "formatting code ..." diff --git a/trace_streamer/gn/BUILD.gn b/trace_streamer/gn/BUILD.gn index e1cd19079420214848ed45d4b7087872d0901248..489954fa19d0ce539379b301e3e95f6a2d71c470 100755 --- a/trace_streamer/gn/BUILD.gn +++ b/trace_streamer/gn/BUILD.gn @@ -12,7 +12,6 @@ # limitations under the License. import("../build/ts.gni") print("target_os", target_os) -print("target_name", target) group("default_deps") { public_configs = [ ":default_config" ] public_deps = [] @@ -73,7 +72,7 @@ config("default") { if (target_os == "windows") { cflags += [ "-D target_cpu_x86_64" ] libs += [ "z" ] - } else if (is_linux || is_macx) { + } else if (is_linux || is_mac) { cflags += [ "-Wa,--noexecstack", "-fcolor-diagnostics", @@ -85,23 +84,14 @@ config("default") { "-fstack-protector-strong", "-fstack-protector-all", "-D_FORTIFY_SOURCE=2 -O2", - - # "-D SUPPORTTHREAD", # if support thread - - # "-D HAVE_ELF_H", "-D target_cpu_x64", "-D target_cpu_x86_64", - - # "-D HAVE_LINK_H", - # "-D_GNU_SOURCE", "-DHAVE_CONFIG_H", "-DCC_IS_CLANG", ] libs += [ "z" ] - - # with_libunwind = true } - if (!use_wasm && !is_win && !is_macx && !is_test && !is_mingw) { + if (!use_wasm && !is_win && !is_mac && !is_test && !is_mingw) { cflags += [ "-D HAVE_LIBUNWIND" ] } @@ -110,8 +100,6 @@ config("default") { cflags += [ "-D IS_WASM", "-D GOOGLE_PROTOBUF_NO_RDTSC", - - # "-D HAVE_LIBUNWIND", "-D target_cpu_x64", "-D target_cpu_x86_64", "-DHAVE_CONFIG_H", @@ -122,7 +110,7 @@ config("default") { } cflags += [ "-D BINDER_ASYNC" ] libs += [ "pthread" ] - if (!is_macx) { + if (!is_mac) { libs += [ "rt" ] } if (!is_win) { @@ -149,7 +137,7 @@ config("default") { config("symbols") { cflags = [ "-O0" ] - if (is_linux || is_macx) { + if (is_linux || is_mac) { cflags += [ "-funwind-tables" ] } } @@ -162,7 +150,7 @@ config("release") { cflags += [ "-O3" ] ldflags = [ "-fstack-protector" ] - if (!is_macx) { + if (!is_mac) { ldflags += [ "-Wl,-O1" ] if (!is_win) { ldflags += [ @@ -172,7 +160,7 @@ config("release") { } } - if (!is_win && !is_macx) { + if (!is_win && !is_mac) { ldflags += [ "-fPIC", "-fpie", @@ -192,10 +180,10 @@ config("executable") { print("use_wasm", use_wasm) ldflags = [] - if (is_linux || (is_macx && !use_wasm)) { + if (is_linux || (is_mac && !use_wasm)) { ldflags += [] } - if (!is_macx && !use_wasm && !is_win) { + if (!is_mac && !use_wasm && !is_win) { ldflags += [ "-Wl,--disable-new-dtags", "-Wl,-z,noexecstack", @@ -205,16 +193,16 @@ config("executable") { "-Wl,-z,relro", ] } - if (!is_macx && !use_wasm) { + if (!is_mac && !use_wasm) { ldflags += [ "-fpie" ] } - if (!is_macx && !use_wasm && !is_win) { + if (!is_mac && !use_wasm && !is_win) { ldflags += [ "-pie" ] } - if (!is_macx) { + if (!is_mac) { ldflags += [ "-Wl,--gc-sections" ] } - if (is_macx) { + if (is_mac) { ldflags += [ "-fdata-sections", "-ffunction-sections", @@ -223,9 +211,9 @@ config("executable") { ldflags += [ "-Wl,-U,__sanitizer_options_link_helper" ] } } - if (!is_debug && !is_macx) { + if (!is_debug && !is_mac) { ldflags += [ "-s" ] - } else if (!is_debug && is_macx) { + } else if (!is_debug && is_mac) { ldflags += [ "-dead_strip" ] } } @@ -252,7 +240,7 @@ config("ts_config") { libs = [ "wsock32" ] libs += [ "ws2_32" ] } - if (!use_wasm && !is_win && !is_macx && !is_test && !is_mingw) { + if (!use_wasm && !is_win && !is_mac && !is_test && !is_mingw) { cflags += [ "-D HAVE_LIBUNWIND" ] } if (enable_ts_utest && !use_wasm) { diff --git a/trace_streamer/gn/CONFIG.gn b/trace_streamer/gn/CONFIG.gn index 6d5e5ad94464bd342586517661b3657cb115f7f5..31b988ee02449a570ae86011ffb2c1629b3703d4 100755 --- a/trace_streamer/gn/CONFIG.gn +++ b/trace_streamer/gn/CONFIG.gn @@ -12,7 +12,7 @@ # limitations under the License. is_win = false is_linux = false -is_macx = false +is_mac = false is_protoc = false with_ebpf_help_table = false is_mingw = false @@ -32,14 +32,14 @@ declare_args() { is_sdkdemo_test = false testonly = false is_fuzz = false - is_macx = false + is_mac = false is_spb = false target = "trace_streamer" } if (target_os == "linux") { is_linux = true } else if (target_os == "macx") { - is_macx = true + is_mac = true } else if (target_os == "windows") { is_win = true is_mingw = true @@ -107,9 +107,6 @@ set_defaults("ohos_source_set") { configs = default_configs } -# set_defaults("ohos_source_hiperf") { -# configs = hiperf_default_configs -# } set_defaults("ohos_shared_library") { configs = default_configs } diff --git a/trace_streamer/gn/toolchain/BUILD.gn b/trace_streamer/gn/toolchain/BUILD.gn index 37f5bc3d01272d238493b786cb65d93443e36f10..657d518c23aa0b8fa1ba1bb9228b5238404dd89a 100755 --- a/trace_streamer/gn/toolchain/BUILD.gn +++ b/trace_streamer/gn/toolchain/BUILD.gn @@ -38,7 +38,7 @@ declare_args() { toolchain("wasm") { # emsdk_dir and em_config are defined in wasm.gni. print("use gcc_like_chain wasm") - if (!is_macx) { + if (!is_mac) { ar = "$emsdk_dir/emscripten/emar --em-config $em_config" } cc = "$emsdk_dir/emscripten/emcc --em-config $em_config" @@ -91,7 +91,7 @@ toolchain("wasm") { tool("alink") { rspfile = "{{output}}.rsp" # must be defined rspfile_content = "{{inputs}}" - if (is_macx) { + if (is_mac) { command = "rm -f {{output}} && libtool -static {{arflags}} -o {{output}} -filelist $rspfile" } else { command = "rm -rf {{output}} && $ar rcsD {{output}} @$rspfile" @@ -162,7 +162,7 @@ toolchain("gcc_like") { } tool("alink") { rspfile = "{{output}}.rsp" # this must be defined - if (is_macx) { + if (is_mac) { rspfile_content = "{{inputs_newline}}" command = "rm -f {{output}} && libtool -static {{arflags}} -filelist $rspfile -o {{output}}" } else { diff --git a/trace_streamer/prebuilts/patch_googletest/googletestbuild.gn b/trace_streamer/prebuilts/patch_googletest/googletestbuild.gn index 7ebdd491c830208cb6e0664ae6daaca30dd58e4a..95335b888d81c6a890d1a1a7187ecad2201dd87a 100755 --- a/trace_streamer/prebuilts/patch_googletest/googletestbuild.gn +++ b/trace_streamer/prebuilts/patch_googletest/googletestbuild.gn @@ -29,8 +29,6 @@ static_library("gtest") { cflags = [ "-Wno-inconsistent-missing-override", - - # "-Dprivate=public", #allow test code access private members "-fprofile-arcs", "-ftest-coverage", "-Wno-unused-command-line-argument", @@ -86,8 +84,6 @@ static_library("gtest") { sources -= [ "googletest/src/gtest-all.cc" ] public_configs = [ ":gtest_config" ] configs += [ ":gtest_private_config" ] - - # configs -= ["//build/config/coverage:default_coverage"] } static_library("gtest_main") { @@ -96,8 +92,6 @@ static_library("gtest_main") { cflags = [ "-Wno-inconsistent-missing-override", - - # "-Dprivate=public", #allow test code access private members "-fprofile-arcs", "-ftest-coverage", "-Wno-unused-command-line-argument", @@ -109,8 +103,6 @@ static_library("gtest_main") { "-Wno-missing-noreturn", ] public_deps = [ ":gtest" ] - - # configs -= ["//build/config/coverage:default_coverage"] } config("gmock_private_config") { @@ -132,7 +124,6 @@ config("gmock_config") { cflags = [ "-Wno-inconsistent-missing-override", - # "-Dprivate=public", #allow test code access private members "-fprofile-arcs", "-ftest-coverage", "-Wno-unused-command-line-argument", @@ -151,7 +142,6 @@ static_library("gmock") { cflags = [ "-Wno-inconsistent-missing-override", - # "-Dprivate=public", #allow test code access private members "-fprofile-arcs", "-ftest-coverage", "-Wno-unused-command-line-argument", @@ -189,8 +179,6 @@ static_library("gmock") { sources -= [ "googlemock/src/gmock-all.cc" ] public_configs = [ ":gmock_config" ] configs += [ ":gmock_private_config" ] - - # configs -= ["//build/config/coverage:default_coverage"] deps = [ ":gtest" ] } @@ -199,8 +187,6 @@ static_library("gmock_main") { cflags = [ "-Wno-inconsistent-missing-override", - - # "-Dprivate=public", #allow test code access private members "-fprofile-arcs", "-ftest-coverage", "-Wno-unused-command-line-argument", @@ -216,6 +202,4 @@ static_library("gmock_main") { ":gmock", ":gtest", ] - - # configs -= ["//build/config/coverage:default_coverage"] } diff --git a/trace_streamer/prebuilts/patch_hiperf/BUILD.gn b/trace_streamer/prebuilts/patch_hiperf/BUILD.gn index 410881f05588afe28961d5d8301388bf8477c3b0..c31ca56f96e9929cd72b6bfe39b267b576f83dad 100644 --- a/trace_streamer/prebuilts/patch_hiperf/BUILD.gn +++ b/trace_streamer/prebuilts/patch_hiperf/BUILD.gn @@ -43,6 +43,9 @@ ohos_source_set("hiperf_src") { subsystem_name = "developtools" part_name = "smartperf_host" cflags = [ "-D ALWAYSTRUE" ] + if (is_mingw) { + cflags += [ "-includeMingW64Fix.h" ] + } sources = [ "./src/callstack.cpp", "./src/callstack.h", diff --git a/trace_streamer/prebuilts/patch_libunwind/libunwindbuild.gn b/trace_streamer/prebuilts/patch_libunwind/libunwindbuild.gn index 426bb8b4df1e924473750734a3f12aa4605bd2d6..93f94de8b6147f6de536e1cfcb01130b893765fe 100644 --- a/trace_streamer/prebuilts/patch_libunwind/libunwindbuild.gn +++ b/trace_streamer/prebuilts/patch_libunwind/libunwindbuild.gn @@ -213,8 +213,6 @@ libunwind_la_SOURCES_local_nounwind = [ "src/mi/dyn-register.c", "src/mi/Ldyn-extract.c", "src/mi/Lfind_dynamic_proc_info.c", - - # "src/mi/Lget_accessors.c", # miss "src/mi/Lget_proc_info_by_ip.c", "src/mi/Lget_proc_name.c", "src/mi/Lput_dynamic_unwind_info.c", @@ -254,8 +252,6 @@ config("unwind_config_public") { cflags = [ "-D_GNU_SOURCE", "-DHAVE_CONFIG_H", - - # "-DNDEBUG", "-DCC_IS_CLANG", "-fcommon", "-Werror", @@ -274,19 +270,6 @@ config("unwind_config_public") { "-Wno-attributes", "-Wno-pointer-to-int-cast", "-Wno-implicit-function-declaration", - - # "-Wno-absolute-value", - # "-Wno-header-guard", - # "-Wno-tautological-constant-out-of-range-compare", - # "-Wno-sometimes-uninitialized", - # "-Wno-int-to-void-pointer-cast", - ] - } - - if (use_wasm) { - cflags += [ - # "-D __mips__" - # "-D WASM", ] } @@ -339,10 +322,6 @@ config("unwind_config_remote_public") { defines += [ "build_remote=1" ] defines += [ "target_cpu=${target_cpu}" ] - - # defines += [ "host_toolchain=${host_toolchain}" ] - # defines += [ "current_toolchain=${current_toolchain}" ] - # defines += [ "default_toolchain=${default_toolchain}" ] } config("unwind_config_arm") { @@ -435,22 +414,14 @@ ohos_source_set("unwind_source") { sources += arm64_source public_configs = [ ":unwind_config_arm64" ] } else if (target_cpu == "x64") { - # deps = [ "unwind_source_x64" ] sources += x64_source public_configs = [ ":unwind_config_x64" ] - - # public_configs = [ - # ":unwind_config_public", - # ":unwind_config_remote_public", - # ":unwind_config_x64", - # ] } sources += [ "src/os-ohos.c" ] } if (defined(ohos_lite)) { - # shared_library("libunwind") { source_set("libunwind") { deps = [ ":unwind_source" ] public_configs = [ ":unwind_config_public" ] @@ -458,14 +429,6 @@ if (defined(ohos_lite)) { } else { source_set("libunwind") { deps = [ ":unwind_source" ] - - # install_images = [ - # "system", - # "updater", - # ] public_configs = [ ":unwind_config_public" ] - - # part_name = "smartperf_host" - # subsystem_name = "developtools" } } diff --git a/trace_streamer/prebuilts/patch_protobuf/protobufbuild.gn b/trace_streamer/prebuilts/patch_protobuf/protobufbuild.gn index c8af4592c9e950c47f4efe5ba4d5a0ae06034343..803128c4b302137d37359d6ff6cac997d334ed70 100755 --- a/trace_streamer/prebuilts/patch_protobuf/protobufbuild.gn +++ b/trace_streamer/prebuilts/patch_protobuf/protobufbuild.gn @@ -116,9 +116,6 @@ if (use_wasm) { "-D HAVE_PTHREAD", "-std=c++17", ] - - #configs = default_configs - public_configs = [ ":protobuf_config" ] } } else { @@ -136,9 +133,6 @@ if (use_wasm) { "-D HAVE_PTHREAD", "-std=c++17", ] - - # configs = default_configs - public_configs = [ ":protobuf_config" ] } } @@ -158,9 +152,6 @@ if (use_wasm) { ] deps = [ ":protobuf_lite_static" ] - - #configs = default_configs - public_configs = [ ":protobuf_config" ] } } else { @@ -172,14 +163,6 @@ if (use_wasm) { "src", ] - #cflags_cc = [ - # "-Wno-sign-compare", - # "-ftrapv", - # "-fstack-protector-strong", - # "-fstack-protector-all", - # "-D_FORTIFY_SOURCE=2 -O2", - - #] cflags = [ "-Wno-sign-compare", "-D HAVE_PTHREAD", @@ -188,12 +171,10 @@ if (use_wasm) { "-fstack-protector-all", "-D_FORTIFY_SOURCE=2 -O2", "-std=c++17", - - # "-Wl,--disable-new-dtags,--rpath,/libpath1:/libpath2" ] ldflags = [ "-fstack-protector" ] - if (!is_macx) { + if (!is_mac) { ldflags += [ "-fuse-ld=gold", "-Wl,--gc-sections", @@ -302,13 +283,6 @@ if (use_wasm) { "$protobuf_dir/**/*.h", "$protobuf_dir/**/*.inc", "src", - - # "/opt/clang-mingw/i686-w64-mingw32/x86_64-linux-gnu", - # "/opt/clang-mingw/i686-w64-mingw32/x86_64-linux-gnu/c++/7", - # "/opt/clang-mingw/i686-w64-mingw32/include/c++/7", - # "/usr/include", - # "/usr/include/c++/7", - # "/usr/include/x86_64-linux-gnu/c++/7", ] if (!use_wasm) { configs = default_configs @@ -317,21 +291,17 @@ if (use_wasm) { "-Wno-sign-compare", "-Wno-unused-function", "-Wno-unused-private-field", - - # "-std=gnu++17", ] cflags = [ "-Wno-sign-compare", "-D HAVE_PTHREAD", "-Wno-unused-function", "-std=c++17", - - # "-Wl,--disable-new-dtags,--rpath,/libpath1:/libpath2" ] deps = [ - ":protobuf_static", ":protobuf_lite_static", + ":protobuf_static", ] public_configs = [ ":protobuf_config" ] diff --git a/trace_streamer/sdk/demo_sdk/test/BUILD.gn b/trace_streamer/sdk/demo_sdk/test/BUILD.gn index 67d4c941b0cd73004ae161d01d099d8181097a6c..7cdd848dbbc96f5c877abe3fa7ce0ae9f0fb8110 100755 --- a/trace_streamer/sdk/demo_sdk/test/BUILD.gn +++ b/trace_streamer/sdk/demo_sdk/test/BUILD.gn @@ -72,7 +72,7 @@ if (target == "sdkdemotest") { "-fno-use-cxa-atexit", "-DIS_UT", ] - if (is_macx) { + if (is_mac) { lib_dirs = [ "/usr/local/opt/llvm/lib" ] } libs = [ "LLVMCore" ] diff --git a/trace_streamer/sdk/dubai_sdk/test/BUILD.gn b/trace_streamer/sdk/dubai_sdk/test/BUILD.gn index 2454379f5e3a6441af00171afb75382670fce29e..0bce70d687ec199ea0d5b358a2af21bb01372550 100755 --- a/trace_streamer/sdk/dubai_sdk/test/BUILD.gn +++ b/trace_streamer/sdk/dubai_sdk/test/BUILD.gn @@ -73,7 +73,7 @@ if (target == "sdkdemotest") { "-fno-use-cxa-atexit", "-DUT_MAC", ] - if (is_macx) { + if (is_mac) { lib_dirs = [ "/usr/local/opt/llvm/lib" ] } libs = [ "LLVMCore" ] diff --git a/trace_streamer/src/BUILD.gn b/trace_streamer/src/BUILD.gn index 8005da8138cdfcbd68ba6f83f351afaa2d5e2af3..ab8f4633ba27dd610918f5edbccefc2bbcf37818 100644 --- a/trace_streamer/src/BUILD.gn +++ b/trace_streamer/src/BUILD.gn @@ -50,7 +50,7 @@ ohos_source_set("ts_sqlite") { "-DSQLITE_OMIT_LOAD_EXTENSION", ] - if (is_mingw) { + if (is_mingw || is_mac) { include_dirs += [ "${THIRD_PARTY}/libbpf/include/uapi" ] } } @@ -81,12 +81,13 @@ trace_streamer_include = [ "${PERF_DIR}/hiperf/include/nonlinux", "${PERF_DIR}/hiperf/include/nonlinux/linux", "${THIRD_PARTY}/perf_include/musl", - "${THIRD_PARTY}/musl", "${THIRD_PARTY}/libunwind/include", "${THIRD_PARTY}/libunwind/src", "${THIRD_PARTY}/perf_include/libbpf", "${THIRD_PARTY}/googletest/googletest/include", "${COMMON_LIBRARY}/c_utils/base/include", + "//prebuilts/clang/ohos/darwin-arm64/llvm/include/c++/v1", + "include/dummy/musl", ] ohos_source_set("trace_streamer_source") { @@ -94,14 +95,11 @@ ohos_source_set("trace_streamer_source") { part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "cfg/trace_streamer_config.cpp", - "cfg/trace_streamer_config.h", "rpc/http_server.cpp", "rpc/http_socket.cpp", "rpc/rpc_server.cpp", "trace_streamer/trace_streamer_filters.cpp", - "trace_streamer/trace_streamer_filters.h", "trace_streamer/trace_streamer_selector.cpp", - "trace_streamer/trace_streamer_selector.h", "version.cpp", ] if (!is_test && !is_fuzz) { @@ -126,8 +124,13 @@ ohos_source_set("trace_streamer_source") { if (!is_independent_compile) { configs = [ "${TS_DIR}/gn:ts_config" ] } + if (is_mingw || is_mac) { + include_dirs += [ + "${THIRD_PARTY}/libbpf/include/uapi", + "${THIRD_PARTY}/elfutils/libelf", + ] + } if (is_mingw) { - include_dirs += [ "${THIRD_PARTY}/libbpf/include/uapi" ] cflags = [ "-includeMingW64Fix.h" ] } diff --git a/trace_streamer/src/base/BUILD.gn b/trace_streamer/src/base/BUILD.gn index 8981ee3bc36bdc2638e469a7ef5eac7a91245579..c71e84ad3ca7de5543a806e366536782dc6160d1 100644 --- a/trace_streamer/src/base/BUILD.gn +++ b/trace_streamer/src/base/BUILD.gn @@ -19,6 +19,7 @@ ohos_source_set("base") { public_deps = [ "sqlite_ext:sqliteext" ] include_dirs = [ "../include", + "${THIRD_PARTY}/sqlite/include", "//third_party/bounds_checking_function/include", ] sources = [ diff --git a/trace_streamer/src/base/index_map.h b/trace_streamer/src/base/index_map.h index 9a82356a9c13905e914f2c55dcc6e6db2b1e335f..6562a0c17c9fe6143fa62dd29b0145e0585833d3 100644 --- a/trace_streamer/src/base/index_map.h +++ b/trace_streamer/src/base/index_map.h @@ -78,44 +78,36 @@ public: rowIndexBak_.clear(); switch (op) { case SQLITE_INDEX_CONSTRAINT_EQ: - ProcessData( - dataQueue, remove, [&](TableRowId id) -> bool { return dataQueue[id] != value; }, - [&](TableRowId id) -> bool { return dataQueue[id] == value; }); + ProcessData(dataQueue, remove, [&](TableRowId id) -> bool { return dataQueue[id] != value; }, + [&](TableRowId id) -> bool { return dataQueue[id] == value; }); break; case SQLITE_INDEX_CONSTRAINT_NE: - ProcessData( - dataQueue, remove, [&](TableRowId id) -> bool { return dataQueue[id] == value; }, - [&](TableRowId id) -> bool { return dataQueue[id] != value; }); + ProcessData(dataQueue, remove, [&](TableRowId id) -> bool { return dataQueue[id] == value; }, + [&](TableRowId id) -> bool { return dataQueue[id] != value; }); break; case SQLITE_INDEX_CONSTRAINT_ISNULL: - ProcessData( - dataQueue, remove, [&](TableRowId id) -> bool { return dataQueue[id] != invalidValue; }, - [&](TableRowId id) -> bool { return dataQueue[id] == invalidValue; }); + ProcessData(dataQueue, remove, [&](TableRowId id) -> bool { return dataQueue[id] != invalidValue; }, + [&](TableRowId id) -> bool { return dataQueue[id] == invalidValue; }); break; case SQLITE_INDEX_CONSTRAINT_ISNOTNULL: - ProcessData( - dataQueue, remove, [&](TableRowId id) -> bool { return dataQueue[id] == invalidValue; }, - [&](TableRowId id) -> bool { return dataQueue[id] != invalidValue; }); + ProcessData(dataQueue, remove, [&](TableRowId id) -> bool { return dataQueue[id] == invalidValue; }, + [&](TableRowId id) -> bool { return dataQueue[id] != invalidValue; }); break; case SQLITE_INDEX_CONSTRAINT_GT: - ProcessData( - dataQueue, remove, [&](TableRowId id) -> bool { return dataQueue[id] <= value; }, - [&](TableRowId id) -> bool { return dataQueue[id] > value; }); + ProcessData(dataQueue, remove, [&](TableRowId id) -> bool { return dataQueue[id] <= value; }, + [&](TableRowId id) -> bool { return dataQueue[id] > value; }); break; case SQLITE_INDEX_CONSTRAINT_GE: - ProcessData( - dataQueue, remove, [&](TableRowId id) -> bool { return dataQueue[id] < value; }, - [&](TableRowId id) -> bool { return dataQueue[id] >= invalidValue; }); + ProcessData(dataQueue, remove, [&](TableRowId id) -> bool { return dataQueue[id] < value; }, + [&](TableRowId id) -> bool { return dataQueue[id] >= invalidValue; }); break; case SQLITE_INDEX_CONSTRAINT_LE: - ProcessData( - dataQueue, remove, [&](TableRowId id) -> bool { return dataQueue[id] > value; }, - [&](TableRowId id) -> bool { return dataQueue[id] < invalidValue; }); + ProcessData(dataQueue, remove, [&](TableRowId id) -> bool { return dataQueue[id] > value; }, + [&](TableRowId id) -> bool { return dataQueue[id] < invalidValue; }); break; case SQLITE_INDEX_CONSTRAINT_LT: - ProcessData( - dataQueue, remove, [&](TableRowId id) -> bool { return dataQueue[id] >= value; }, - [&](TableRowId id) -> bool { return dataQueue[id] < invalidValue; }); + ProcessData(dataQueue, remove, [&](TableRowId id) -> bool { return dataQueue[id] >= value; }, + [&](TableRowId id) -> bool { return dataQueue[id] < invalidValue; }); break; default: break; diff --git a/trace_streamer/src/base/sqlite_ext/BUILD.gn b/trace_streamer/src/base/sqlite_ext/BUILD.gn index fc81a20b99f644f2d120052636c2c54b01bc8fcd..9cdf7cea753b0a8af5249cd59e1ca845da756e3d 100644 --- a/trace_streamer/src/base/sqlite_ext/BUILD.gn +++ b/trace_streamer/src/base/sqlite_ext/BUILD.gn @@ -13,18 +13,14 @@ import("//build/ohos.gni") import("../../../build/ts.gni") -config("sqlite_config") { +ohos_source_set("sqliteext") { + sources = [ "sqlite_ext_funcs.cpp" ] include_dirs = [ "${THIRD_PARTY}/sqlite/include", "${THIRD_PARTY}/bounds_checking_function/include", "..", ] - cflags = [ "-Wno-attributes" ] if (!is_independent_compile) { configs = [ "${TS_DIR}/gn:ts_config" ] } } -source_set("sqliteext") { - sources = [ "sqlite_ext_funcs.cpp" ] - public_configs = [ ":sqlite_config" ] -} diff --git a/trace_streamer/src/base/ts_common.h b/trace_streamer/src/base/ts_common.h index def2368cb87b0c1c8e348dba906302533bea4d5f..1464210cc5f9ed4545ed5e5970c81a275a19c237 100644 --- a/trace_streamer/src/base/ts_common.h +++ b/trace_streamer/src/base/ts_common.h @@ -103,7 +103,6 @@ enum EndState { TASK_PARKED = 512, // (R+) Process groups in the foreground TASK_FOREGROUND = 2048, - // Hisi spec state TASK_RUNNABLE_BINDER = 2049, TASK_MAX = 4096, TASK_INVALID = 9999 diff --git a/trace_streamer/src/filter/BUILD.gn b/trace_streamer/src/filter/BUILD.gn index bb1df100a5111db1cee56bfc2da1b3af92177023..638e72666a2b051bcd0ff57ef66e930eb8c26e8e 100644 --- a/trace_streamer/src/filter/BUILD.gn +++ b/trace_streamer/src/filter/BUILD.gn @@ -81,6 +81,9 @@ ohos_source_set("filter") { "${THIRD_PARTY}/json/single_include/nlohmann", "../proto_reader/include", ".", - "${THIRD_PARTY}/musl", ] + + if (is_mingw || is_mac) { + include_dirs += [ "${THIRD_PARTY}/elfutils/libelf" ] + } } diff --git a/trace_streamer/src/include/BUILD.gn b/trace_streamer/src/include/BUILD.gn deleted file mode 100755 index f8cfa79d148b1376b0e326b4a623d50346ac28b6..0000000000000000000000000000000000000000 --- a/trace_streamer/src/include/BUILD.gn +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import("//build/ohos.gni") -ohos_source_set("ibase") { - subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" - part_name = "${OHOS_PROFILER_PART_NAME}" - sources = [ - "codec_cov.h", - "file.h", - "log.h", - "numerical_to_string.h", - "parting_string.h", - "string_to_numerical.h", - ] - include_dirs = [] - public_deps = [] - deps = [] - sources += [ "/usr/x86_64-w64-mingw32/include/windows.h" ] - if (!is_independent_compile) { - configs = [ "${TS_DIR}/gn:ts_config" ] - } -} diff --git a/trace_streamer/src/parser/ebpf_parser/BUILD.gn b/trace_streamer/src/parser/ebpf_parser/BUILD.gn index 35dd529d1eca66e62d03bc91114eff756fcffe36..866cfe67782d45a238d560b64ab5432faea841bc 100644 --- a/trace_streamer/src/parser/ebpf_parser/BUILD.gn +++ b/trace_streamer/src/parser/ebpf_parser/BUILD.gn @@ -41,28 +41,17 @@ ohos_source_set("ebpf_parser_src") { "${THIRD_PARTY}/sqlite/include", "${THIRD_PARTY}/bounds_checking_function/include", ] + if (is_mingw || is_mac) { + include_dirs += [ "${THIRD_PARTY}/elfutils/libelf" ] + } + public_deps = [ "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/memory_data:memory_data_reader" ] - if (is_win || is_macx || is_mingw) { + if (is_win || is_mac || is_mingw) { include_dirs += [ "${THIRD_PARTY}/perf_include/linux", "${THIRD_PARTY}/perf_include/musl", ] } - - if (enable_ts_utest && !use_wasm) { - cflags = [ - "-fprofile-arcs", - "-ftest-coverage", - ] - ldflags = [ - "-fprofile-arcs", - "-ftest-coverage", - "--coverage", - ] - if (is_test) { - cflags += [ "-D IS_UT" ] - } - } } group("ebpf_parser") { diff --git a/trace_streamer/src/parser/hiperf_parser/BUILD.gn b/trace_streamer/src/parser/hiperf_parser/BUILD.gn index bb93335f27ba72d178f786e2b23539c041831e1a..15a919d3785d1385a48fa031cc2c79bfef9c6460 100644 --- a/trace_streamer/src/parser/hiperf_parser/BUILD.gn +++ b/trace_streamer/src/parser/hiperf_parser/BUILD.gn @@ -42,8 +42,10 @@ ohos_source_set("hiperf_parser_src") { "${THIRD_PARTY}/googletest/googletest/include", ] include_dirs += [ "${THIRD_PARTY}/libunwind/include" ] - if (is_mingw) { + if (is_mingw || is_mac) { include_dirs += [ "${THIRD_PARTY}/libbpf/include/uapi" ] + } + if (is_mingw) { cflags = [ "-includeMingW64Fix.h" ] } } diff --git a/trace_streamer/src/parser/htrace_pbreader_parser/BUILD.gn b/trace_streamer/src/parser/htrace_pbreader_parser/BUILD.gn index 41df546731dd940f186d95d65c16f27a95d6fd65..0c71512f8c93a8740f5de0b2b715187a38d461af 100755 --- a/trace_streamer/src/parser/htrace_pbreader_parser/BUILD.gn +++ b/trace_streamer/src/parser/htrace_pbreader_parser/BUILD.gn @@ -59,7 +59,6 @@ ohos_source_set("htrace_pbreader_parser_src") { "${PERF_DIR}/hiperf/include", "${PERF_DIR}/hiperf/include/nonlinux/linux", "${PERF_DIR}/hiperf/include/nonlinux", - "${THIRD_PARTY}/musl", "${THIRD_PARTY}/googletest/googletest/include", "${THIRD_PARTY}/perf_include/musl", "${THIRD_PARTY}/perf_include/libbpf", @@ -68,7 +67,15 @@ ohos_source_set("htrace_pbreader_parser_src") { "${THIRD_PARTY}/perf_include/linux", "../hiperf_parser", "../hiperf_parser/include", + "../../../commonlibrary/c_utils/base/include", + "../../include/dummy/musl", ] + if (is_mingw || is_mac) { + include_dirs += [ + "${THIRD_PARTY}/elfutils/libelf", + "${THIRD_PARTY}/libbpf/include/uapi", + ] + } if (!is_independent_compile) { configs = [ "${TS_DIR}/gn:ts_config" ] @@ -100,7 +107,7 @@ group("htrace_pbreader_parser") { "${THIRD_PARTY}/protobuf:protobuf_static", ] - if (!use_wasm && !is_win && !is_mingw && !is_macx && !is_test) { + if (!use_wasm && !is_win && !is_mingw && !is_mac && !is_test) { if (!is_independent_compile) { if (target_cpu == "arm64") { deps += [ "//third_party/libunwind:unwind_source_arm64_opt" ] diff --git a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_js_cpu_profiler_parser.cpp b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_js_cpu_profiler_parser.cpp index 75b01b11181ee3f7aa7ecc16836dd08c848003f2..42c743dc24c9948318d6dff210f9d1f2d9723d78 100644 --- a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_js_cpu_profiler_parser.cpp +++ b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_js_cpu_profiler_parser.cpp @@ -48,7 +48,7 @@ void from_json(const json& j, Node& node) j.at("id").get_to(node.id); j.at("callFrame").get_to(node.callFrame); j.at("hitCount").get_to(node.hitCount); - for (int32_t i = 0; i < j["children"].size(); i++) { + for (size_t i = 0; i < j["children"].size(); i++) { int child = j["children"][i]; nodes_.emplace(child, node.id); auto children = std::to_string(child); @@ -94,7 +94,7 @@ void HtraceJsCpuProfilerParser::ParseJsCpuProfiler(std::string result) uint32_t sample = std::numeric_limits::max(); uint64_t sampleEndTime = startTime; uint64_t dur = 0; - for (auto i = 0; i < jMessage.at("samples").size(); i++) { + for (size_t i = 0; i < jMessage.at("samples").size(); i++) { if (sample != std::numeric_limits::max() && sample != jMessage.at("samples")[i]) { dur = (sampleEndTime * TIME_SECOND_COVER) - (startTime * TIME_SECOND_COVER); auto startNewTime = diff --git a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_js_memory_parser.cpp b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_js_memory_parser.cpp index 3976221f170cdc136b63f353892cb885b9e06a8e..09f88c09a95f04c05467b7a6719fe33cb2def61a 100644 --- a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_js_memory_parser.cpp +++ b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_js_memory_parser.cpp @@ -52,13 +52,13 @@ struct Snapshot { }; void from_json(const json& j, Meta& v) { - for (int32_t i = 0; i < j["node_fields"].size(); i++) { + for (size_t i = 0; i < j["node_fields"].size(); i++) { v.nodeFields.emplace_back(j["node_fields"][i]); } - for (int32_t i = 0; i < j["node_types"].size(); i++) { + for (size_t i = 0; i < j["node_types"].size(); i++) { std::vector nodeTypes; if (j["node_types"][i].is_array()) { - for (int32_t m = 0; m < j["node_types"][i].size(); m++) { + for (size_t m = 0; m < j["node_types"][i].size(); m++) { nodeTypes.emplace_back(j["node_types"][i][m]); } v.nodeTypes.emplace_back(nodeTypes); @@ -67,13 +67,13 @@ void from_json(const json& j, Meta& v) v.nodeTypes.emplace_back(nodeTypes); } } - for (int32_t i = 0; i < j["edge_fields"].size(); i++) { + for (size_t i = 0; i < j["edge_fields"].size(); i++) { v.edgeFields.emplace_back(j["edge_fields"][i]); } - for (int32_t i = 0; i < j["edge_types"].size(); i++) { + for (size_t i = 0; i < j["edge_types"].size(); i++) { std::vector edgeTypes; if (j["edge_types"][i].is_array()) { - for (int32_t m = 0; m < j["edge_types"][i].size(); m++) { + for (size_t m = 0; m < j["edge_types"][i].size(); m++) { edgeTypes.emplace_back(j["edge_types"][i][m]); } v.edgeTypes.emplace_back(edgeTypes); @@ -82,16 +82,16 @@ void from_json(const json& j, Meta& v) v.edgeTypes.emplace_back(edgeTypes); } } - for (int32_t i = 0; i < j["trace_function_info_fields"].size(); i++) { + for (size_t i = 0; i < j["trace_function_info_fields"].size(); i++) { v.traceFunctionInfoFields.emplace_back(j["trace_function_info_fields"][i]); } - for (int32_t i = 0; i < j["trace_node_fields"].size(); i++) { + for (size_t i = 0; i < j["trace_node_fields"].size(); i++) { v.traceNodeFields.emplace_back(j["trace_node_fields"][i]); } - for (int32_t i = 0; i < j["sample_fields"].size(); i++) { + for (size_t i = 0; i < j["sample_fields"].size(); i++) { v.sampleFields.emplace_back(j["sample_fields"][i]); } - for (int32_t i = 0; i < j["location_fields"].size(); i++) { + for (size_t i = 0; i < j["location_fields"].size(); i++) { v.locationFields.emplace_back(j["location_fields"][i]); } return; @@ -121,20 +121,20 @@ std::vector g_ids; void from_json(const json& j, Nodes& v) { int32_t edgeIndex = 0; - for (int32_t i = 0; i < j.size() / NODES_SINGLE_LENGTH; i++) { + for (size_t i = 0; i < j.size() / NODES_SINGLE_LENGTH; i++) { v.types.emplace_back(j[i * NODES_SINGLE_LENGTH]); v.names.emplace_back(j[i * NODES_SINGLE_LENGTH + OFFSET_FIRST]); v.ids.emplace_back(j[i * NODES_SINGLE_LENGTH + OFFSET_SECOND]); v.selfSizes.emplace_back(j[i * NODES_SINGLE_LENGTH + OFFSET_THIRD]); v.edgeCounts.emplace_back(j[i * NODES_SINGLE_LENGTH + OFFSET_FOURTH]); - for (int32_t m = edgeIndex; m < edgeIndex + v.edgeCounts.at(i); m++) { + for (size_t m = edgeIndex; m < edgeIndex + v.edgeCounts.at(i); m++) { g_fromNodeIds.emplace_back(j[i * NODES_SINGLE_LENGTH + OFFSET_SECOND]); } edgeIndex += v.edgeCounts.at(i); v.traceNodeIds.emplace_back(j[i * NODES_SINGLE_LENGTH + OFFSET_FIFTH]); v.detachedness.emplace_back(j[i * NODES_SINGLE_LENGTH + OFFSET_SIXTH]); } - for (int32_t m = 0; m < j.size(); m++) { + for (size_t m = 0; m < j.size(); m++) { g_ids.emplace_back(j[m]); } } @@ -150,7 +150,7 @@ const int32_t EDGES_SINGLE_LENGTH = 3; void from_json(const json& j, Edges& v) { v.fromNodeIds = g_fromNodeIds; - for (int32_t i = 0; i < j.size() / EDGES_SINGLE_LENGTH; i++) { + for (size_t i = 0; i < j.size() / EDGES_SINGLE_LENGTH; i++) { v.types.emplace_back(j[i * EDGES_SINGLE_LENGTH]); v.nameOrIndexes.emplace_back(j[i * EDGES_SINGLE_LENGTH + OFFSET_FIRST]); v.toNodes.emplace_back(j[i * EDGES_SINGLE_LENGTH + OFFSET_SECOND]); @@ -168,7 +168,7 @@ struct Location { const int32_t LOCATION_SINGLE_LENGTH = 4; void from_json(const json& j, Location& v) { - for (int32_t i = 0; i < j.size() / LOCATION_SINGLE_LENGTH; i++) { + for (size_t i = 0; i < j.size() / LOCATION_SINGLE_LENGTH; i++) { v.objectIndexes.emplace_back(j[i * LOCATION_SINGLE_LENGTH]); v.scriptIds.emplace_back(j[i * LOCATION_SINGLE_LENGTH + OFFSET_FIRST]); v.lines.emplace_back(j[i * LOCATION_SINGLE_LENGTH + OFFSET_SECOND]); @@ -183,7 +183,7 @@ struct Sample { const int32_t SAMPLE_SINGLE_LENGTH = 2; void from_json(const json& j, Sample& v) { - for (int32_t i = 0; i < j.size() / SAMPLE_SINGLE_LENGTH; i++) { + for (size_t i = 0; i < j.size() / SAMPLE_SINGLE_LENGTH; i++) { v.timestampUs.emplace_back(j[i * SAMPLE_SINGLE_LENGTH]); v.lastAssignedIds.emplace_back(j[i * SAMPLE_SINGLE_LENGTH + OFFSET_FIRST]); } @@ -194,7 +194,7 @@ struct Strings { }; void from_json(const json& j, Strings& v) { - for (int32_t i = 0; i < j.size(); i++) { + for (size_t i = 0; i < j.size(); i++) { v.strings.emplace_back(j[i]); } } @@ -210,7 +210,7 @@ struct TraceFuncInfo { const int32_t TRACE_FUNC_INFO_SINGLE_LENGTH = 6; void from_json(const json& j, TraceFuncInfo& v) { - for (int32_t i = 0; i < j.size() / TRACE_FUNC_INFO_SINGLE_LENGTH; i++) { + for (size_t i = 0; i < j.size() / TRACE_FUNC_INFO_SINGLE_LENGTH; i++) { v.functionIds.emplace_back(j[i * TRACE_FUNC_INFO_SINGLE_LENGTH]); v.names.emplace_back(j[i * TRACE_FUNC_INFO_SINGLE_LENGTH + OFFSET_FIRST]); v.scriptNames.emplace_back(j[i * TRACE_FUNC_INFO_SINGLE_LENGTH + OFFSET_SECOND]); @@ -421,11 +421,11 @@ void HtraceJSMemoryParser::ParserSnapInfo(int32_t fileId, const std::string& key, const std::vector>& types) { - for (int32_t m = 0; m < types[0].size(); ++m) { + for (size_t m = 0; m < types[0].size(); ++m) { (void)traceDataCache_->GetJsHeapInfoData()->AppendNewData(fileId, key, 0, std::numeric_limits::max(), types[0][m]); } - for (int32_t i = 1; i < types.size(); ++i) { + for (size_t i = 1; i < types.size(); ++i) { (void)traceDataCache_->GetJsHeapInfoData()->AppendNewData(fileId, key, 1, std::numeric_limits::max(), types[i][0]); } @@ -451,7 +451,7 @@ void HtraceJSMemoryParser::ParserJSSnapInfo(int32_t fileId, const json& jMessage void HtraceJSMemoryParser::ParseNodes(int32_t fileId, const json& jMessage) { jsonns::Nodes node = jMessage.at("nodes"); - for (int32_t i = 0; i < node.names.size(); ++i) { + for (size_t i = 0; i < node.names.size(); ++i) { auto type = node.types[i]; auto name = node.names[i]; auto id = node.ids[i]; @@ -469,7 +469,7 @@ void HtraceJSMemoryParser::ParseNodes(int32_t fileId, const json& jMessage) void HtraceJSMemoryParser::ParseEdges(int32_t fileId, const json& jMessage) { jsonns::Edges edge = jMessage.at("edges"); - for (int32_t i = 0; i < edge.types.size(); ++i) { + for (size_t i = 0; i < edge.types.size(); ++i) { auto type = edge.types[i]; auto nameOrIndex = edge.nameOrIndexes[i]; auto toNode = edge.toNodes[i]; @@ -484,7 +484,7 @@ void HtraceJSMemoryParser::ParseEdges(int32_t fileId, const json& jMessage) void HtraceJSMemoryParser::ParseLocation(int32_t fileId, const json& jMessage) { jsonns::Location location = jMessage.at("locations"); - for (int32_t i = 0; i < location.columns.size(); ++i) { + for (size_t i = 0; i < location.columns.size(); ++i) { auto objectIndex = location.objectIndexes[i]; auto scriptId = location.scriptIds[i]; auto line = location.lines[i]; @@ -496,7 +496,7 @@ void HtraceJSMemoryParser::ParseLocation(int32_t fileId, const json& jMessage) void HtraceJSMemoryParser::ParseSample(int32_t fileId, const json& jMessage) { jsonns::Sample sample = jMessage.at("samples"); - for (int32_t i = 0; i < sample.timestampUs.size(); ++i) { + for (size_t i = 0; i < sample.timestampUs.size(); ++i) { auto timestampUs = sample.timestampUs[i]; auto lastAssignedId = sample.lastAssignedIds[i]; (void)traceDataCache_->GetJsHeapSampleData()->AppendNewData(fileId, timestampUs, lastAssignedId); @@ -506,7 +506,7 @@ void HtraceJSMemoryParser::ParseSample(int32_t fileId, const json& jMessage) void HtraceJSMemoryParser::ParseString(int32_t fileId, const json& jMessage) { jsonns::Strings string = jMessage.at("strings"); - for (int32_t i = 0; i < string.strings.size(); ++i) { + for (size_t i = 0; i < string.strings.size(); ++i) { (void)traceDataCache_->GetJsHeapStringData()->AppendNewData(fileId, i, string.strings[i]); } return; @@ -514,7 +514,7 @@ void HtraceJSMemoryParser::ParseString(int32_t fileId, const json& jMessage) void HtraceJSMemoryParser::ParseTraceFuncInfo(int32_t fileId, const json& jMessage) { jsonns::TraceFuncInfo traceFuncInfo = jMessage.at("trace_function_infos"); - for (int32_t i = 0; i < traceFuncInfo.functionIds.size(); ++i) { + for (size_t i = 0; i < traceFuncInfo.functionIds.size(); ++i) { auto functionId = traceFuncInfo.functionIds[i]; auto name = traceFuncInfo.names[i]; auto scriptName = traceFuncInfo.scriptNames[i]; @@ -529,7 +529,7 @@ void HtraceJSMemoryParser::ParseTraceFuncInfo(int32_t fileId, const json& jMessa void HtraceJSMemoryParser::ParseTraceNode(int32_t fileId, const json& jMessage) { jsonns::TraceTree traceTree = jMessage.at("trace_tree"); - for (int32_t i = 0; i < traceTree.ids.size(); ++i) { + for (size_t i = 0; i < traceTree.ids.size(); ++i) { auto id = traceTree.ids[i]; auto funcInfoIndex = traceTree.functionInfoIndexes[i]; auto count = traceTree.counts[i]; diff --git a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_js_memory_parser.h b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_js_memory_parser.h index a3420300de6b565058c772291b7db12438619efd..fb79393de3c483a10e4337c53e7e39575803ff10 100644 --- a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_js_memory_parser.h +++ b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_js_memory_parser.h @@ -50,7 +50,6 @@ private: void ParseTraceNode(int32_t fileId, const json& jMessage); void ParserSnapInfo(int32_t fileId, const std::string& key, const std::vector>& types); int32_t type_ = 0; - int32_t pid_ = 0; const std::string snapshotEnd_ = "{\"id\":1,\"result\":{}}"; const std::string timeLineEnd_ = "{\"id\":2,\"result\":{}}"; const std::string jsCpuProfilerStart_ = "{\"id\":3,\"result\":{}}"; diff --git a/trace_streamer/src/parser/print_event_parser.cpp b/trace_streamer/src/parser/print_event_parser.cpp index 58ba319141e6ad04a0e9b1b130b0947b0914d0eb..c9b17935f48c84c1da50c4a650b4f6a7e80577da 100644 --- a/trace_streamer/src/parser/print_event_parser.cpp +++ b/trace_streamer/src/parser/print_event_parser.cpp @@ -12,17 +12,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - #include "print_event_parser.h" - -#include - #include "animation_filter.h" #include "clock_filter_ex.h" #include "frame_filter.h" #include "stat_filter.h" #include "string_to_numerical.h" - +#include namespace SysTuning { namespace TraceStreamer { PrintEventParser::PrintEventParser(TraceDataCache* dataCache, const TraceStreamerFilters* filter) diff --git a/trace_streamer/src/table/base/table_base.cpp b/trace_streamer/src/table/base/table_base.cpp index 882ecd6135737b14ddd0979d45a9aeddc7806251..b9bef31a848ead2e4b82d16903766c3f7190019e 100644 --- a/trace_streamer/src/table/base/table_base.cpp +++ b/trace_streamer/src/table/base/table_base.cpp @@ -272,14 +272,14 @@ void TableBase::Cursor::FilterTS(unsigned char op, sqlite3_value* argv, const st case SQLITE_INDEX_CONSTRAINT_LT: { indexMap_->IntersectLessEqual(times, v, getValue); break; - case SQLITE_INDEX_CONSTRAINT_ISNOTNULL: { - indexMap_->RemoveNullElements(times, v); - break; - } - default: - break; - } // end of switch (op) - } + } + case SQLITE_INDEX_CONSTRAINT_ISNOTNULL: { + indexMap_->RemoveNullElements(times, v); + break; + } + default: + break; + } // end of switch (op) } int32_t TableBase::Cursor::RowId(sqlite3_int64* id) diff --git a/trace_streamer/src/trace_data/trace_data_cache_base.cpp b/trace_streamer/src/trace_data/trace_data_cache_base.cpp index 0bc4ad2d1afa5bab59e3371d807e9d0c95091caa..497eea8d28f1d0ed0ef193ce1df171c1073aad0a 100644 --- a/trace_streamer/src/trace_data/trace_data_cache_base.cpp +++ b/trace_streamer/src/trace_data/trace_data_cache_base.cpp @@ -24,8 +24,7 @@ TraceDataCacheBase::TraceDataCacheBase() internalThreadsData_.emplace_back(0); internalThreadsData_.front().internalPid_ = 0; GetDataIndex(""); - auto it = statusString_.rbegin(); - for (it++; it != statusString_.rend(); it++) { + for (auto it = statusString_.begin(); it != statusString_.end(); it++) { threadStatus2Value_[it->second] = it->first; } } diff --git a/trace_streamer/src/trace_data/trace_data_cache_base.h b/trace_streamer/src/trace_data/trace_data_cache_base.h index 1c10105f989faf84a58240a599b03ffe02864ece..7af5e65538a7646f9340bfaffb1054b5c4095b05 100644 --- a/trace_streamer/src/trace_data/trace_data_cache_base.h +++ b/trace_streamer/src/trace_data/trace_data_cache_base.h @@ -68,8 +68,8 @@ public: {TASK_UNINTERRUPTIBLE_IO, "D-IO"}, {TASK_UNINTERRUPTIBLE_NIO, "D-NIO"}, {TASK_RUNNING, "Running"}, - {TASK_INTERRUPTED, "I"}, - {TASK_TRACED, "T"}, + {TASK_INTERRUPTED, "T"}, + {TASK_TRACED, "t"}, {TASK_EXIT_DEAD, "X"}, {TASK_ZOMBIE, "Z"}, {TASK_CLONE, "I"}, @@ -78,7 +78,7 @@ public: {TASK_DK_IO, "DK-IO"}, {TASK_DK_NIO, "DK-NIO"}, {TASK_TRACED_KILL, "TK"}, - {TASK_WAKEKILL, "R"}, + {TASK_WAKEKILL, "K"}, {TASK_PARKED, "P"}, {TASK_FOREGROUND, "R+"}, {TASK_RUNNABLE_BINDER, "R-B"}, diff --git a/trace_streamer/src/trace_data/trace_stdtype.h b/trace_streamer/src/trace_data/trace_stdtype.h index edc6b41210a232b676aef7d3bed5fe241ca37abc..58334ef79188d2cf083355c801caa3a2c5d318b4 100644 --- a/trace_streamer/src/trace_data/trace_stdtype.h +++ b/trace_streamer/src/trace_data/trace_stdtype.h @@ -1941,7 +1941,7 @@ public: void UpdateCallStackSliceId(uint64_t row, uint64_t callStackSliceId); void SetEndTimeAndFlag(uint64_t row, uint64_t ts, uint64_t expectDur, uint64_t expectEnd); void Erase(uint64_t row); - static const uint32_t GetAbnormalStartEndTimeState() + static uint32_t GetAbnormalStartEndTimeState() { return abnormalStartEndTimeState_; } diff --git a/trace_streamer/src/trace_streamer/trace_streamer_selector.cpp b/trace_streamer/src/trace_streamer/trace_streamer_selector.cpp index 2d37483555cb8d5dadc6b3e184c69c2887cb3084..d2266184fa06eb555fb1cd1c8e16f110b19d9e73 100644 --- a/trace_streamer/src/trace_streamer/trace_streamer_selector.cpp +++ b/trace_streamer/src/trace_streamer/trace_streamer_selector.cpp @@ -289,6 +289,10 @@ void TraceStreamerSelector::SetCancel(bool cancel) { traceDataCache_->SetCancel(cancel); } +void TraceStreamerSelector::UpdateBinderRunnableTraceStatus(bool status) +{ + traceDataCache_->UpdateBinderRunnableTraceStatus(status); +} void TraceStreamerSelector::UpdateAnimationTraceStatus(bool status) { traceDataCache_->UpdateAnimationTraceStatus(status); @@ -301,9 +305,5 @@ void TraceStreamerSelector::UpdateAppStartTraceStatus(bool status) { traceDataCache_->UpdateAppStartTraceStatus(status); } -void TraceStreamerSelector::UpdateBinderRunnableTraceStatus(bool status) -{ - traceDataCache_->UpdateBinderRunnableTraceStatus(status); -} } // namespace TraceStreamer } // namespace SysTuning diff --git a/trace_streamer/test/BUILD.gn b/trace_streamer/test/BUILD.gn index 1c4307737aa63ca665f6383c3c6b462a10655b16..097252ade9ae2114af811e6323c767c4699dec0c 100755 --- a/trace_streamer/test/BUILD.gn +++ b/trace_streamer/test/BUILD.gn @@ -144,7 +144,7 @@ if (is_test) { "-fno-use-cxa-atexit", "-DIS_UT", ] - if (is_macx) { + if (is_mac) { lib_dirs = [ "/usr/local/opt/llvm/lib" ] } libs = [ "LLVMCore" ]