Documentation/accounting/delay-accounting.txt


Chinese translated version of Documentation/accounting/delay-accounting.txt

If you have any comment or update to the content, please contact the

original document maintainer directly.  However, if you have a problem

communicating in English you can also ask the Chinese maintainer for

help.  Contact the Chinese maintainer if this translation is outdated

or if there is a problem with the translation.

Chinese maintainer: 林天智 <lintianzhi1992@gmail.com>

---------------------------------------------------------------------

Documentation/accounting/delay-accounting.txt的中文翻译

如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文

交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻

译存在问题,请联系中文版维护者。

中文版维护者: 林天智 <lintianzhi1992@gmail.com>

以下为正文

---------------------------------------------------------------------


Delay accounting

----------------

延迟统计

=======


Tasks encounter delays in execution when they wait

for some kernel resource to become available e.g. a

runnable task may wait for a free CPU to run on.

当任务在执行的时候因为等待一些内核资源而有延迟的时候。比如,一个可运行的任务可能会等待CPU的空闲


The per-task delay accounting functionality measures

the delays experienced by a task while

当发生以下的情况的时候,平均任务等待时间被描述地很好:


a) waiting for a CPU (while being runnable)

b) completion of synchronous block I/O initiated by the task

c) swapping in pages

d) memory reclaim

a) 等CPU(当可运行的时候)

b) 等待I/O的完成

c) 交换页面

d) 重新分配内存


and makes these statistics available to userspace through

the taskstats interface.

并且让用户空间通过任务状态接口可以访问这些统计信息


Such delays provide feedback for setting a task's cpu priority,

io priority and rss limit values appropriately. Long delays for

important tasks could be a trigger for raising its corresponding priority.

这些延迟为设置一个任务的cpu优先级提供了反馈,io 优先和rss适当地限制了值。一些重要任务的长延迟可能会为提升它对应的权限作为一个触发器。


The functionality, through its use of the taskstats interface, also provides

delay statistics aggregated for all tasks (or threads) belonging to a

thread group (corresponding to a traditional Unix process). This is a commonly

needed aggregation that is more efficiently done by the kernel.

虽然函数用了任务状态接口,它也为所有任务(或线程)提供了属于它的线程组的聚合统计信息(对应于传统的Unix线程)。这是一个由内核来做会非常有效的一般性聚合需求。


Userspace utilities, particularly resource management applications, can also

aggregate delay statistics into arbitrary groups. To enable this, delay

statistics of a task are available both during its lifetime as well as on its

exit, ensuring continuous and complete monitoring can be done.

用户空间特性,特别是资源管理应用,可以聚合延迟统计信息到任意组。为了激活这个功能,一个任务的延迟统计在它的生命周期以及退出的时候必须是可用的,保证持续,完整的监控可以被完成。


接口

------


Delay accounting uses the taskstats interface which is described

in detail in a separate document in this directory. Taskstats returns a

generic data structure to userspace corresponding to per-pid and per-tgid

statistics. The delay accounting functionality populates specific fields of

this structure. See

    include/linux/taskstats.h

延迟统计使用了任务状态接口(在这个目录下不同的文档已经详细描述)。任务状态给用户空间每个pid,每个tgid返回一个通用的统计信息的数据结构。延迟统计函数定义在这个文件:

include/linux/taskstats.h


for a description of the fields pertaining to delay accounting.

It will generally be in the form of counters returning the cumulative

delay seen for cpu, sync block I/O, swapin, memory reclaim etc.

这个数据结构会在累计cpu,I/O同步阻塞,数据换入,重新分配内存等延迟信息时使用到。


Taking the difference of two successive readings of a given

counter (say cpu_delay_total) for a task will give the delay

experienced by the task waiting for the corresponding resource

in that interval.

为了一个任务连续读两个给定的计数器,会给出在那个间隙内那个任务等待对于资源的延迟。


When a task exits, records containing the per-task statistics

are sent to userspace without requiring a command. If it is the last exiting

task of a thread group, the per-tgid statistics are also sent. More details

are given in the taskstats interface description.

当一个任务退出时,记录了包括每个任务的统计信息会发送到用户空间而不需要任何命令。如果这是在这个线程组中最后一个退出的任务,per-tgid统计信息也会被送出。更多的细节在任务状态接口中描述。


The getdelays.c userspace utility in this directory allows simple commands to

be run and the corresponding delay statistics to be displayed. It also serves

as an example of using the taskstats interface.

在这个目录下,getdelay.c 的用户空间功能允许执行简单的命令,对应的延迟统计会被列出来,同样可以作为使用任务状态接口的例子。


使用

-----


Compile the kernel with

       CONFIG_TASK_DELAY_ACCT=y

       CONFIG_TASKSTATS=y

用一下参数编译内核:

CONFIG_TASK_DELAY_ACCT=y

CONFIG_TASKSTATS=y


Delay accounting is enabled by default at boot up.

To disable, add

  nodelayacct

to the kernel boot options. The rest of the instructions

below assume this has not been done.

延迟统计在启动的时候会默认开启

要禁止的话,增加

nodelayacct

作为内核启动选项,剩下的介绍假设这个参数并没有被加入。


After the system has booted up, use a utility

similar to  getdelays.c to access the delays

seen by a given task or a task group (tgid).

The utility also allows a given command to be

executed and the corresponding delays to be

seen.

在内核启动之后,给定一个任务或者任务组,使用一个和getdeay.c相似的功能去访问延迟。对应的功能同样允许执行命令然后显示对应的延迟信息


General format of the getdelays command

getdelays命令的通用格式


getdelays [-t tgid] [-p pid] [-c cmd...]


Get delays, since system boot, for pid 10

# ./getdelays -p 10

(output similar to next case)

当系统启动时获取pid为10的延迟信息

# ./getdelays -p 10

(输出和下一个例子相似)


Get sum of delays, since system boot, for all pids with tgid 5

当系统启动时获取所有tgid为5的合计延迟,

# ./getdelays -t 5


CPU     count   real total      virtual total   delay total

       7876    92005750        100000000       24001500

IO      count   delay total

       0       0

SWAP    count   delay total

       0       0

RECLAIM count   delay total

       0       0


Get delays seen in executing a given simple command

执行一个命令,并且获取它的延迟信息

# ./getdelays -c ls /


bin   data1  data3  data5  dev  home  media  opt   root  srv        sys  usr

boot  data2  data4  data6  etc  lib   mnt    proc  sbin  subdomain  tmp  var



CPU     count   real total      virtual total   delay total

       6       4000250         4000000         0

IO      count   delay total

       0       0

SWAP    count   delay total

       0       0

RECLAIM count   delay total

       0       0



  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
目标检测(Object Detection)是计算机视觉领域的一个核心问题,其主要任务是找出图像中所有感兴趣的目标(物体),并确定它们的类别和位置。以下是对目标检测的详细阐述: 一、基本概念 目标检测的任务是解决“在哪里?是什么?”的问题,即定位出图像中目标的位置并识别出目标的类别。由于各类物体具有不同的外观、形状和姿态,加上成像时光照、遮挡等因素的干扰,目标检测一直是计算机视觉领域最具挑战性的任务之一。 二、核心问题 目标检测涉及以下几个核心问题: 分类问题:判断图像中的目标属于哪个类别。 定位问题:确定目标在图像中的具体位置。 大小问题:目标可能具有不同的大小。 形状问题:目标可能具有不同的形状。 三、算法分类 基于深度学习的目标检测算法主要分为两大类: Two-stage算法:先进行区域生成(Region Proposal),生成有可能包含待检物体的预选框(Region Proposal),再通过卷积神经网络进行样本分类。常见的Two-stage算法包括R-CNN、Fast R-CNN、Faster R-CNN等。 One-stage算法:不用生成区域提议,直接在网络中提取特征来预测物体分类和位置。常见的One-stage算法包括YOLO系列(YOLOv1、YOLOv2、YOLOv3、YOLOv4、YOLOv5等)、SSD和RetinaNet等。 四、算法原理 以YOLO系列为例,YOLO将目标检测视为回归问题,将输入图像一次性划分为多个区域,直接在输出层预测边界框和类别概率。YOLO采用卷积网络来提取特征,使用全连接层来得到预测值。其网络结构通常包含多个卷积层和全连接层,通过卷积层提取图像特征,通过全连接层输出预测结果。 五、应用领域 目标检测技术已经广泛应用于各个领域,为人们的生活带来了极大的便利。以下是一些主要的应用领域: 安全监控:在商场、银行
将QT += core QT -= gui CONFIG += c++11 TARGET = UavRectifyLoadLIb CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp # The following define makes your compiler emit warnings if you use # any feature of Qt which as been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS win32{ CONFIG(debug, debug|release){ DESTDIR = $$PWD/../../../../RasterManager/bin/Debug } else{ DESTDIR = $$PWD/../../../../RasterManager/bin/release } INCLUDEPATH += $$PWD/../../../include/gdal1101 DEPENDPATH += $$PWD/../../../include/gdal1101 } else{ CONFIG(debug, debug|release){ DESTDIR = $$PWD/../../../product/release32 } else{ DESTDIR = $$PWD/../../../product/release32 } } # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lUAVAutoRectifyMt -lUAVAutoRectify -lUAVAutoRectifyFi INCLUDEPATH += $$PWD/../include DEPENDPATH += $$PWD/../include unix:!macx: LIBS += -L$$PWD/../../../lib/opencvf249/ -lopencv_core unix:!macx: LIBS += -L$$PWD/../../../lib/opencvf249/ -lopencv_highgui unix:!macx: LIBS += -L$$PWD/../../../lib/opencvf249/ -lopencv_imgproc INCLUDEPATH += $$PWD/../../../lib/opencvf249 DEPENDPATH += $$PWD/../../../lib/opencvf249 unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_core #unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_highgui unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_imgproc unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_features2d unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_imgcodecs INCLUDEPATH += $$PWD/../../../../../../../usr/local/include DEPENDPATH += $$PWD/../../../../../../../usr/local/include unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lDEMDriver unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lProjection unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lIImage_gC QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO 转为cmake格式
06-11
根据给出的代码,可以将其转化为以下CMake代码: ``` cmake_minimum_required(VERSION 3.5) project(UavRectifyLoadLIb LANGUAGES CXX) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) find_package(Qt5Core REQUIRED) add_executable(UavRectifyLoadLIb main.cpp ) target_link_libraries(UavRectifyLoadLIb PRIVATE Qt5::Core UAVAutoRectifyMt UAVAutoRectify UAVAutoRectifyFi DEMDriver Projection IImage_gC opencv_core opencv_highgui opencv_imgproc opencv_features2d opencv_imgcodecs ) target_include_directories(UavRectifyLoadLIb PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../../include/gdal1101 ${CMAKE_CURRENT_SOURCE_DIR}/../include ${CMAKE_CURRENT_SOURCE_DIR}/../../../lib/opencvf249 ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../../usr/local/include ) if(UNIX AND NOT APPLE) target_link_directories(UavRectifyLoadLIb PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../../product/release32 ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../../usr/local/lib ) endif() if(WIN32) if(CMAKE_BUILD_TYPE STREQUAL "Debug") set_target_properties(UavRectifyLoadLIb PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/../../../../RasterManager/bin/Debug ) else() set_target_properties(UavRectifyLoadLIb PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/../../../../RasterManager/bin/release ) endif() else() if(CMAKE_BUILD_TYPE STREQUAL "Debug") set_target_properties(UavRectifyLoadLIb PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/../../../product/release32 ) else() set_target_properties(UavRectifyLoadLIb PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/../../../product/release32 ) endif() endif() ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值