国外设计工作室网站,网站html地图怎么做,免费微商城小程序模板,网站推广过程nonolog起步笔记-6-log解压过程初探 再看解压过程建立调试工程修改makefile添加新的launch项 注#xff1a;重新学习nanolog的README.mdPost-Execution Log Decompressor 下面我们尝试了解#xff0c;解压的过程#xff0c;是如何得到文件头部的meta信息的。 再看解压过程
… nonolog起步笔记-6-log解压过程初探 再看解压过程建立调试工程修改makefile添加新的launch项 注重新学习nanolog的README.mdPost-Execution Log Decompressor 下面我们尝试了解解压的过程是如何得到文件头部的meta信息的。 再看解压过程
./decompressor decompress /tmp/logFile 如上图发现除了前两条有内容其它的其实是空的。 这里我们得到第一个猜想是原始的binary log中没有有效的消息总条数。所以解析的程序 将所有的可能的条目都解了一遍。这是因为实际的应用中因为每client(用户线程),实际一直在已经写满的circlebuffer中工作不会有空白的。
也没有序号因为时间戳作为唯一的时间标识。
今天先这样明天再继续。建一个新的工程之后详细了解解压的过程。 目前还没有找到meta是如何存入到最终的log中。只看到每record如何记录注册到meta中的logregistID
建立调试工程
修改makefile
可以有许多选择这里我们还是基于 sample下的GNUmakefile来进行。 ./sample/GNUmakefile 因为我们现在的focus在解压所以我们不希望每次clean将上将做好的log文件删除。 所以
clean:rm -f *.o sampleApplication /tmp/logFile compressedLog改为
clean:rm -f *.o sampleApplication compressedLog意外的收获发现其中还有一个clean-all,这是很好能解决昨天说的有时无法下断的问题。 因为每次编译都是从runtime目录拷过来libNanoLog.a如果本目录存在这个文件将不会重编libNanoLog.a。
# Cleans up the NanoLog files as well
clean-all: cleanrm -f libNanoLog.a decompressor$(MAKE) clean-all -C $(NANOLOG_RUNTIME_DIR)所以可以将昨天的贴文中的tasks.json内容改为 “make clean-all”, tasks: [{type: shell,label: make clean-all,command: make,args: [-f,GNUmakefile,clean],options: {cwd: ${workspaceFolder}/sample},problemMatcher: [$gcc],detail: cleaning: make clean},添加新的launch项
.vscode/launch.json{name: C Launch decompressor,type: cppdbg,request: launch,program: ${workspaceFolder}/sample/decompressor,args: [/tmp/logFile],environment: [{ name: config, value: Debug }],cwd: ${workspaceFolder}/sample,setupCommands: [{description: Enable pretty-printing for gdb,text: -enable-pretty-printing,ignoreFailures: true}]}这样做好分析解压过程的准备。
注重新学习nanolog的README.md
https://github.com/PlatformLab/NanoLog## Sample Applications
cd sample# Modify the application
nano main.ccmake clean-all
make
./sampleApplication
./decompressor decompress /tmp/logFilePost-Execution Log Decompressor
The execution of the user application should generate a compressed, binary log file (default locations: ./compressedLog or /tmp/logFile). To make the log file human-readable, simply invoke the decompressor application with the log file.
./decompressor decompress ./compressedLogAfter building the NanoLog library, the decompressor executable can be found in either the ./runtime directory (for C17 NanoLog) or the user app directory (for Preprocessor NanoLog).
再向后是单元测试