lcnt 环境搭建

抄书:otp_doc_html_R13B04/lib/tools-2.6.5.1/doc/html/lcnt_chapter.html#id2252207

[b]lcnt - The Lock Profiler[/b]

Internally in the Erlang runtime system locks are used to protect resources from being updated from multiple threads in a fatal way. Locks are necessary to ensure that the runtime system works properly but it also introduces a couple of limitations. Lock contention and locking overhead.

With lock contention we mean when one thread locks a resource and another thread, or threads, tries to acquire the same resource at the same time. The lock will deny the other thread access to the resource and the thread will be blocked from continuing its execution. The second thread has to wait until the first thread has completed its access to the resource and unlocked it. The lcnt tool measures these lock conflicts.

Locks has an inherent cost in execution time and memory space. It takes time initialize, destroy, aquiring or releasing locks. To decrease lock contention it some times necessary to use finer grained locking strategies. This will usually also increase the locking overhead and hence there is a tradeoff between lock contention and overhead. In general, lock contention increases with the number of threads running concurrently. The lcnt tool does not measure locking overhead.
[b]

5.1 Enabling lock-counting[/b]

For investigation of locks in the emulator we use an internal tool called lcnt (short for lock-count). The VM needs to be compiled with this option enabled. To enable this, use:

cd $ERL_TOP
./configure --enable-lock-counter


Another way to enable this alongside a normal VM is to compile it at emulator directory level, much like a debug build. To compile it this way do the following,
[i]
cd $ERL_TOP/erts/emulator
make lcnt FLAVOR=smp[/i]


and then starting Erlang with,

[i]$ERL_TOP/bin/cerl -lcnt[/i]


To verify that you lock-counting enabled check that [lock-counting] appears in the status text when the VM is started.

Erlang R13B03 (erts-5.7.4) [source] [64-bit] [smp:8:8] [rq:8] [async-threads:0] [hipe]
[kernel-poll:false] [lock-counting]


[b]5.2 Getting started[/b]

Once you have a lock counting enabled VM the module lcnt can be used. The module is intended to be used from the current running nodes shell. To access remote nodes use lcnt:clear(Node) and lcnt:collect(Node).

All locks are continuously monitored and its statistics updated. Use lcnt:clear/0 to initially clear all counters before running any specific tests. This command will also reset the duration timer internally.

To retrieve lock statistics information use, lcnt:collect/0,1. The collect operation will start a lcnt server if it not already started. All collected data will be built into an erlang term and uploaded to the server and a duration time will also be uploaded. This duration is the time between lcnt:clear/0,1 and lcnt:collect/0,1.

Once the data is collected to the server it can be filtered, sorted and printed in many different ways.

See the reference manual for a description of each function.
MC Debug Main Switch : Default Debug Level Main Board BIOS ID = 1 Notify Manufac IPMI Success GPIO_106 Value = 1. [GetDataFromFv2] StartBase is 0xFFF70040 [VariableSyncPeimEntry] Get UpdateFlag from Cust FV: 0x24 [GetDataFromFv2] StartBase is 0xFFF10080 [VariableSyncPeimEntry] Get UpdateFlag from Backup FV: 0x24 [VariableSyncPeimEntry] VARIABLE_SYNC_HOB Data. IsFirstTimeRunFlag : 0 IsVariableSyncFlag : 0 IsApcbHashErrorFlag: 0 cPcdBiosDebugModeFinalSwitch: 0x0 FsAdjustHostPCIBusMapPeim start Disable adjusting the host PCI bus map. mIpmiLibCheckManufacNotifyDesc [Info] I3cMasterPei.c NumberOfSockets: 2. Standard-mode HCNT:LCNT = 645:855 Fast-mode HCNT:LCNT = 135:240 Standard-mode HCNT:LCNT = 645:855 Fast-mode HCNT:LCNT = 135:240 Standard-mode HCNT:LCNT = 645:855 Fast-mode HCNT:LCNT = 135:240 Standard-mode HCNT:LCNT = 645:855 Fast-mode HCNT:LCNT = 135:240 Standard-mode HCNT:LCNT = 645:855 Fast-mode HCNT:LCNT = 135:240 Standard-mode HCNT:LCNT = 645:855 Fast-mode HCNT:LCNT = 135:240 :0x2DC2000 is SMN Get 2th Skt FCH bus: 0x80 Standard-mode HCNT:LCNT = 645:855 Fast-mode HCNT:LCNT = 135:240 :0x2DC3000 is SMN Standard-mode HCNT:LCNT = 645:855 Fast-mode HCNT:LCNT = 135:240 :0x2DD4000 is SMN Standard-mode HCNT:LCNT = 645:855 Fast-mode HCNT:LCNT = 135:240 :0x2DD5000 is SMN Standard-mode HCNT:LCNT = 645:855 Fast-mode HCNT:LCNT = 135:240 :0x2DD6000 is SMN Standard-mode HCNT:LCNT = 645:855 Fast-mode HCNT:LCNT = 135:240 :0x2DDB000 is SMN Standard-mode HCNT:LCNT = 645:855 Fast-mode HCNT:LCNT = 135:240 Pei Get Apcb Success 8372E3E
07-18
(defun c:d2(/ aCen cAng cCen cPl cRad cReg fDr it lCnt lLst mSp pCen pT1 pT2 ptLst R tHt tLst vlaPl vlaTab vLst cTxt oldCol nPl clFlg actDoc tPt1 tPt2 cAng tiPt oSnp *error*) (vl-load-com) (defun Extract_DXF_Values(Ent Code) (mapcar 'cdr (vl-remove-if-not '(lambda(a)(=(car a)Code)) (entget Ent))) ); end of (defun *error*(msg) (setvar "CMDECHO" 1) (if oSnp(setvar "OSMODE" oSnp)) (if mSp(vla-EndUndoMark actDoc)) (princ) ); end of *error* (if (and (setq cPl(entsel "\n选择多段线 ")) (= "LWPOLYLINE"(car(Extract_DXF_Values(car cPl)0))) ); end and (progn (princ "\n稍等... \n") (setq vlaPl(vlax-ename->vla-object(car cPl)) ptLst(mapcar 'append (setq vLst(Extract_DXF_Values(car cPl)10)) (mapcar 'list(Extract_DXF_Values(car cPl)42))) r 2 lCnt 0 tLst '((1 0 "孔号")(1 1 "X")(1 2 "Y")(1 3 "Z")) actDoc(vla-get-ActiveDocument (vlax-get-acad-object)) mSp(vla-get-ModelSpace actDoc) tHt(getvar "TEXTSIZE") ); end setq (vla-StartUndoMark actDoc) (setvar "CMDECHO" 0) (setq oSnp(getvar "OSMODE")) (foreach vert ptLst (setq vert(trans vert 0 1) tLst(append tLst (list(list r 0(itoa(1+ lCnt))) (list r 1(rtos(car vert)2 1)) (list r 2(rtos(cadr vert)2 1)) (list r 3 "")))) (if(and (/= 0.0(last vert)) (setq pt1(vlax-curve-GetPointAtParam vlaPl lCnt)) (setq pt2(vlax-curve-GetPointAtParam vlaPl(1+ lCnt))) ); end and (setq r(1+ r) cRad(abs(/(distance pt1 pt2) 2(sin(/(* 4(atan(abs(last vert))))2)))) aCen(vlax-curve-GetPointAtParam vlaPl(+ 0.5 lCnt)) fDr(vlax-curve-getFirstDeriv vlaPl (vlax-curve-getParamAtPoint vlaPl aCen)) pCen(trans (polar aCen(-(if(minusp(last vert)) pi(* 2 pi)) (atan(/(car fDr)(cadr fDr))))cRad)0 1) tLst(append tLst(list (list r 0 "center") (list r 1(rtos(car pCen)2 1)) (list r 2(rtos(cadr pCen)2 1)) (list r 3(rtos cRad 2 1)))) ); end setq ); end if (setq r(1+ r) lCnt(1+ lCnt)) ); end foreach (setq vlaTab(vla-AddTable mSp (vlax-3D-point '(0 0 0)) (+ 1(/(length tLst)4)) 4 (* 3 tHt)(* 10 tHt))) (foreach i tLst (vl-catch-all-apply 'vla-SetText(cons vlaTab i)) (vla-SetCellTextHeight vlaTab(car i)(cadr i)tHt) (vla-SetCellAlignment vlaTab(car i)(cadr i)acMiddleCenter) ); end foreach (vla-put-VertCellMargin vlaTab (* 0.75 tHt)) (vla-put-Height vlaTab(* 1.75(/(length tLst)4))) (vla-SetColumnWidth vlaTab 0 (* 5 tHt)) (vla-SetColumnWidth vlaTab 0 (* 5 tHt)) ;;; (vla-put-RepeatTopLabels vlaTab :vlax-true) ;;; (vla-put-BreakSpacing vlaTab (* 3 tHt)) (vla-DeleteRows vlaTab 0 1) (princ "\n-->指定插入点 ") (command "_.copybase" (trans '(0 0 0)0 1)(entlast) "") (command "_.erase" (entlast) "") (command "_.pasteclip" pause) (if(= :vlax-true(vla-get-Closed vlaPl)) (progn (setq nPl(vla-Copy vlaPl)) (command "_.region" (entlast) "") (setq cCen(vlax-get(setq cReg (vlax-ename->vla-object(entlast)))'Centroid)) (vla-Delete cReg) (setq clFlg T) ); end progn ); end if (setq lCnt 0) (foreach v vLst (if clFlg (setq cAng(angle cCen(trans v 0 1)) iPt(polar v cAng (* 2 tHt))) (setq tPt1(vlax-curve-GetPointAtParam vlaPl (- lCnt 0.0000001)) tPt2(vlax-curve-GetPointAtParam vlaPl (+ lCnt 0.0000001)) iPt(polar v(+(* pi 0.5)(if(minusp (setq cAng(angle tPt1(if tPt2 tPt2 (polar tPt1(* 0.5 pi)0.0000001))))) cAng(- cAng)))(* 2 tHt)) ); end setq ); end if (setvar "OSMODE" 0) (setq cTxt(vla-AddText mSp(itoa(1+ lCnt)) (vlax-3d-point iPt) tHt) tiPt(vla-get-InsertionPoint cTxt) lCnt(1+ lCnt) ); end setq ); end foreach (setvar "OSMODE" oSnp) (setvar "CMDECHO" 1) (vla-EndUndoMark actDoc) ); end progn (princ "\n<!> It isn't LwPolyline! Quit. <!> ") ); end if (gc) (princ) ); end of c:d2选择多线LWPOLYLINE改为点
09-06
源码地址: https://pan.quark.cn/s/d1f41682e390 miyoubiAuto 米游社每日米游币自动化Python脚本(务必使用Python3) 8更新:更换cookie的获取地址 注意:禁止在B站、贴吧、或各大论坛大肆传播! 作者已退游,项目不维护了。 如果有能力的可以pr修复。 小引一波 推荐关注几个非常可爱有趣的女孩! 欢迎B站搜索: @嘉然今天吃什么 @向晚大魔王 @乃琳Queen @贝拉kira 第三方库 食用方法 下载源码 在Global.py中设置米游社Cookie 运行myb.py 本地第一次运行时会自动生产一个文件储存cookie,请勿删除 当前仅支持单个账号! 获取Cookie方法 浏览器无痕模式打开 http://user.mihoyo.com/ ,登录账号 按,打开,找到并点击 按刷新页面,按下图复制 Cookie: How to get mys cookie 当触发时,可尝试按关闭,然后再次刷新页面,最后复制 Cookie。 也可以使用另一种方法: 复制代码 浏览器无痕模式打开 http://user.mihoyo.com/ ,登录账号 按,打开,找到并点击 控制台粘贴代码并运行,获得类似的输出信息 部分即为所需复制的 Cookie,点击确定复制 部署方法--腾讯云函数版(推荐! ) 下载项目源码和压缩包 进入项目文件夹打开命令行执行以下命令 xxxxxxx为通过上面方式或取得米游社cookie 一定要用双引号包裹!! 例如: png 复制返回内容(包括括号) 例如: QQ截图20210505031552.png 登录腾讯云函数官网 选择函数服务-新建-自定义创建 函数名称随意-地区随意-运行环境Python3....
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值