perfmonctl -接口PMU

内容简介

#include

#include

long perfmonctl(intfd, intcmd, void *arg, intnarg);

描述

perfmonctlsystem call provides an interface to PMU (performance monitoring unit). PMU consists of PMD (performance monitoring data) registers and PMC (performance monitoring control) registers, where are gathered the hardware statistic.

perfmonctl will apply a function cmd to input arguments arg. The number of arguments is defined by input variable narg. fd specifies the perfmon context to operate on.

实现的 cmd命令是:

标签

描述

PFM_CREATE_CONTEXT

set up a context

perfmonctl(intfd, PFM_CREATE_CONTEXT , pfarg_context_t *ctxt,1);

The fd parameter is ignored. A new context is created as specified in ctxtand its file descriptor is returned in ctxt->ctx_fd.

The file descriptor, apart from passing it to perfmonctl, can be used to read event notifications (type pfm_msg_t) using the read(2) system call. Both select(2) and poll(2) can be used to wait for event notifications.

The context can be destroyed using the close(2) system call.

PFM_WRITE_PMCS

set PMC registers

perfmonctl(intfd, PFM_WRITE_PMCS , pfarg_pmc_t *pmcs,n);

PFM_WRITE_PMDS

set PMD registers

perfmonctl(intfd, PFM_WRITE_PMDS , pfarg_pmd_t *pmds,n);

PFM_READ_PMDS

read PMD registers

perfmonctl(intfd, PFM_READ_PMDS , pfarg_pmd_t *pmds,n);

PFM_START

start monitoring

perfmonctl(intfd,PFM_START,arg,1);

perfmonctl(intfd,PFM_START,NULL,0);

PFM_STOP

stop monitoring

perfmonctl(intfd,PFM_START,NULL,0);

PFM_LOAD_CONTEXT

attach the context to a thread

perfmonctl(intfd, PFM_LOAD_CONTEXT ,pfarg_load_t *largs,1);

PFM_UNLOAD_CONTEXT

detach the context from a thread

perfmonctl(intfd,PFM_UNLOAD_CONTEXT,NULL,0);

PFM_RESTART

restart monitoring after recieving an overflow notification

perfmonctl(intfd,PFM_RESTART,NULL,0);

PFM_CREATE_EVTSETS

create or modify event sets

perfmonctl(intfd,PFM_CREATE_EVTSETS,pfarg_setdesc_t*desc,n);

PFM_DELETE_EVTSETS

delete event sets

perfmonctl(intfd,PFM_DELETE_EVTSET,pfarg_setdesc_t*desc,n);

PFM_GETINFO_EVTSETS

get information about event sets

perfmonctl(intfd,PFM_GETINFO_EVTSETS,pfarg_setinfo_t*info,n);

返回值

performctlreturns zero when the operation is successful. On error -1 is returned and an error code is set inerrno.

可用性

This syscall is implemented only on the IA-64 architecture since kernel 2.6.

另请参阅

¥ 我要打赏

纠错/补充

收藏

加QQ群啦,易百教程官方技术学习群

注意:建议每个人选自己的技术方向加群,同一个QQ最多限加 3 个群。

linux stop函数,perfmonctl()函数 Unix/Linux相关推荐

  1. linux c++ 程序运行时间,总结UNIX/LINUX下C++程序计时的方法

    前言 良好的计时器可帮助程序开发人员确定程序的性能瓶颈,或对不同算法进行性能比较.但要精确测量程序的运行时间并不容易,因为进程切换.中断.共享的多用户.网络流量.高速缓存访问及转移预测等因素都会对程序 ...

  2. linux下启动tlq命令,UNIX/LINUX命令

    1 如何查看磁盘使用情况 查看磁盘空间 df -k 可以看出磁盘空间使用情况.以及分区或者逻辑卷的挂载目录等. $ df -k Filesystem 1024-blocks Free %Used Iu ...

  3. linux下 远程桌面连接,Unix/Linux下通过远程桌面连接Windows OS

    不知Microsoft出于什么考虑,在Windows XP中只允许一个Session通过远程桌面连接,如果一台XP为管理工作站,只有它能够访问后端的SAN Switch或存储系统,那么多人将无法同时使 ...

  4. linux中ftok的作用,Unix/Linux编程之ftok函数用法

    linux 中ftok函数的用法 1.函数作用: 系统建立IPC通讯(如消息队列.共享内存时)必须指定一个ID值.通常情况下,该id值通过ftok函数得到 2.函数原型: #include #incl ...

  5. windows下的linux工具,Windows下的Unix/Linux工具集:UnxUtils

    最近用dos命令多了些,感觉方便得多,对付一些老机器特别有效~只是可惜dos命令功效有限,如果能使用到linux系统上类似grep,sed,cat这样命令就完美了~ 果然和想得差不多,网上还真有&qu ...

  6. Unit 3: Unix/Linux File System 3.1 Unix/Linux File System Sleuthkit and Autopsy

    >> Now let's learn and practice a well-known open source forensic analysis tool called Sleuth ...

  7. linux退出脚本命令,【Unix/Linux.Shell Script】退出状态,exit命令

    每一条命令,不管是内置,shell函数,还是外部的,当它退出时,都会返回一个小的整数值给引用它的程序,这是程序的退出状态. 在shell下执行程序时,有许多方式可以取出程序的退出状态. 退出状态值 以 ...

  8. Linux学习:简单基础的Linux系统命令

    Linux操作系统介绍     肯.汤普逊 丹尼斯.里奇     美国 贝尔实验室     1970-1973     BCPL->new B->C->UNIX系统->Mini ...

  9. linux 网卡驱动编译安装包,linux网卡驱动程序的编译与安装

    一般来说,目前新版的Linux预设可以支持的网络卡芯片组数量已经很完备了,很多网络卡芯片都已经被支持, 例如RLT 8139芯片( RealTek 8139 )的网络卡所以使用者可以很轻易的设定好他们 ...

最新文章

  1. BTree C 语言实例
  2. 【PHP】curl_init() 如何排错????
  3. [P2P技术]如何配置JXTA Shell(airclh)
  4. 细说 | 失效的private修饰符
  5. Mysql中慢查询Sql的记录查看
  6. 解决IntelliJ IDEA在笔记本屏幕中部分界面显示不全被遮挡的问题
  7. Structured Streaming 整合 Kafka指南
  8. webpack不报错但是图标和字体却无法显示
  9. 不用刷新,用 dfuse 流式搜索提供即时用户体验
  10. 使用scrapy简单爬取网易新闻
  11. TeamView: 为了进一步增强安全性,在发起连接之前,我们希望您先验证您的账户
  12. 未来视频编码_设计编码营销并消费未来
  13. tello通信_鸿蒙HarmonyOS and 大疆Tello 无人机 BUILD SUCCESS
  14. 智能型手机中的音频设计(转)
  15. 最短路径问题(附航班最小价格练习)
  16. 关于GBA模拟器悲惨的速度问题
  17. linux can软件,Linux学习系列十:使用CAN
  18. Python requests ip代理爬虫报错 HTTPSConnectionPool(host=‘xxxxx‘, port=443) Max retries exceed
  19. 树形DP zoj 3527
  20. 【金猿技术展】维智ST-AI ——全栈时空扩展智能决策技术

热门文章

  1. 站长工具|百度搜索框提示功能
  2. c/s 自动升级(WebService)
  3. 编程界的“马太效应”,是什么在阻止你变得更加优秀?
  4. Redis 数据同步机制分析
  5. sublime text2如何连接FTP/SFTP——图文详细教程
  6. Goland显示“Cannot resolve symbol XXX“ 进行更新IDE的索引库
  7. PHP的strlen与mb_strlen
  8. 耳机不分主从是什么意思_“在网吧上网给玩家配置这样的耳机,是什么意思?”哈哈哈...
  9. 微信小程序点击按钮实现弹出模态框
  10. matlab最小错误率决策,利用MATLAB实现最小错误率贝叶斯判别