/d/tracing
时间: 2023-08-12 15:07:10 浏览: 50
您好!对于跟踪(tracing)的问题,我可以提供一些基本信息。跟踪是一种常用的技术,用于收集和分析程序的执行信息。通过跟踪,您可以了解程序在运行时的行为和性能状况。
在软件开发中,跟踪可以帮助我们定位和修复bug,优化代码性能,以及进行系统调优。常见的跟踪技术包括日志记录、调试器、性能分析器等。
如果您有具体的跟踪问题或者需要更详细的解释,请告诉我,我会尽力帮助您。
相关问题
linux 启动时 trace
要在Linux启动时启用trace,您可以按照以下步骤操作:
1. 首先,您需要在grub配置中设置默认内核版本为带有trace功能的内核版本。您可以使用命令`grub2-set-default 'CentOS Linux (替换成自己的内核版本) 7 (Core)'`来设置默认内核版本。
2. 接下来,您可以调用trace事件来查看内核日志。首先,在终端中执行以下命令以创建一个目录并将debugfs文件系统挂载到该目录:
```
mount mkdir data/debugfs
mount -t debugfs debugfs /data/debugfs
```
3. 然后,选择您想要追踪的tracer。您可以通过查看`current_tracer`和`available_tracers`文件来查看可用的tracer,并使用以下命令将所选的tracer设置为当前tracer:
```
cat current_tracer
cat available_tracers
echo blk > current_tracer
```
4. 您可以打开或关闭您要追踪的日志。使用以下命令打开或关闭跟踪:
```
echo 1 > tracing_on // 打开跟踪
echo 0 > tracing_on // 关闭跟踪
```
如果您想在打开跟踪后执行某个操作并在关闭跟踪前进行跟踪,您可以使用以下命令:
```
echo 1 > tracing_on
run_test
echo 0 > tracing_on
```
另外,如果您想要找到您感兴趣的trace event目录并打开或关闭它,您可以使用以下命令:
```
echo 1 > enable // 打开trace event目录
echo 0 > enable // 关闭trace event目录
```
5. 最后,您可以查看您关注的tracer的输出信息。根据您的需求,可以通过以下方式之一来查看trace的内容:
- 使用`cat trace`命令直接阅读`trace`文件的内容。
- 使用`cat latency_trace`命令阅读`latency_trace`文件的内容,该文件保存了与`trace`相同的信息,但组织方式略有不同,主要用于方便分析系统中与延迟相关的信息。
- 使用`cat trace_pipe | grep XXX`命令查找包含特定关键字XXX的内容。
例如,如果您希望查看相机(trace event)的输出信息,您可以执行以下命令:
```
adb root
adb shell "echo 1 > /d/tracing/events/camera/enable"
adb shell "echo 1 > /d/tracing/tracing_on"
adb shell cat /d/tracing/trace_pipe | grep "CameraKeyWords"
```
综上所述,这些是启用trace的步骤和方法。请根据您的需求选择适合您的方法并执行相应的命令。
2023-06-09 09:46:11.022252: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1900] Ignoring visible gpu device (device: 0, name: GeForce GT 610, pci bus id: 0000:01:00.0, compute capability: 2.1) with Cuda compute capability 2.1. The minimum required Cuda capability is 3.5. 2023-06-09 09:46:11.022646: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX AVX2 To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. WARNING:tensorflow:5 out of the last 9 calls to <function Model.make_test_function.<locals>.test_function at 0x0000017BB39D0670> triggered tf.function retracing. Tracing is expensive and the excessive number of tracings could be due to (1) creating @tf.function repeatedly in a loop, (2) passing tensors with different shapes, (3) passing Python objects instead of tensors. For (1), please define your @tf.function outside of the loop. For (2), @tf.function has experimental_relax_shapes=True option that relaxes argument shapes that can avoid unnecessary retracing. For (3), please refer to https://www.tensorflow.org/guide/function#controlling_retracing and https://www.tensorflow.org/api_docs/python/tf/function for more details. WARNING:tensorflow:6 out of the last 11 calls to <function Model.make_test_function.<locals>.test_function at 0x0000017BB3AE83A0> triggered tf.function retracing. Tracing is expensive and the excessive number of tracings could be due to (1) creating @tf.function repeatedly in a loop, (2) passing tensors with different shapes, (3) passing Python objects instead of tensors. For (1), please define your @tf.function outside of the loop. For (2), @tf.function has experimental_relax_shapes=True option that relaxes argument shapes that can avoid unnecessary retracing. For (3), please refer to https://www.tensorflow.org/guide/function#controlling_retracing and https://www.tensorflow.org/api_docs/python/tf/function for more details.
这是 TensorFlow 在运行时输出的一些警告信息。其中包含了以下几个内容:
1. TensorFlow 检测到了一个 GPU 设备,但由于该设备的 CUDA 计算能力版本太低(2.1),不满足 TensorFlow 最低要求(3.5),因此被忽略。
2. TensorFlow 检测到了一些 CPU 功能,包括 AVX 和 AVX2 指令集。这些指令集可以在一些性能关键的操作中加速计算。为了在其他操作中启用它们,需要使用适当的编译器标志重新构建 TensorFlow。
3. TensorFlow 输出了两个关于 tf.function 的警告信息。这些信息表明,在某些情况下,使用 tf.function 可能会导致 TensorFlow 重新跟踪函数的执行图,并且跟踪是一项昂贵的操作。这可能是由于多次在循环中重复定义 tf.function,或者传递了不同形状的张量,或者传递了 Python 对象而不是张量等原因。为了避免不必要的跟踪,建议将 tf.function 定义在循环外部,或使用实验性的 experimental_relax_shapes=True 选项来松弛参数形状。可以参考 TensorFlow 的文档了解更多细节。