xiaopengli89/precord

There may be compatibility problems. What system versions and hardware configurations are mainly adapted to?

LRF520 opened this issue · 23 comments

(1) I tried many computers, including win7, win10 and MacOS 10.15. I found that this tool can only perform well on win10. There is no data output on win7 and no FPS data output on MacOS.What system versions and hardware configurations are mainly adapted to?

(2) The output results of the command line can't be used directly now. It's easier to get API data by outputting JSON data in the command line window.

(3)Some errors occurred while running on MacOS. There may be compatibility problems.

image

image

Last login: Thu Sep 1 18:30:23 on ttys002

The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh.
For more details, please visit https://support.apple.com/kb/HT208050.
apple:~ apple$ /Users/apple/Desktop/precord
/Users/apple/Desktop/precord: line 1: 3: command not found
/Users/apple/Desktop/precord: line 2: 0: command not found
/Users/apple/Desktop/precord: line 3: 4096: command not found
/Users/apple/Desktop/precord: line 4: 12288: command not found
/Users/apple/Desktop/precord: line 5: 2826240: command not found
/Users/apple/Desktop/precord: line 6: 2850816: command not found
/Users/apple/Desktop/precord: line 7: 1148808: command not found
/Users/apple/Desktop/precord: line 8: ?????: command not found
/Users/apple/Desktop/precord: line 9: syntax error near unexpected token (' /Users/apple/Desktop/precord: line 9: ??H__PAGEZEROx__TEXT?(?(__text__TEXT4?? 4?__stubs__TEXT?? ???__stub_helper__TEXT?? ?? ?__gcc_except_tab__TEXTd? X9d? __const__TEXT?/"??/"__unwind_info__TEXT?
(0r?
(__eh_frame__TEXT(?(?__DATA_CONST?(??(?__got__DATA_CONST?(??(?__const__DATA_CONST??(8???(x__DATA@+@@+@__la_symbol_ptr__DATA@+?@+?__data__DATA?F+??F+__thread_vars__DATAHI+?HI+__thread_data__DATA?J+h?J+__thread_bss__DATA0L+ __bss__DATAPM+H__common__DATA?O+pH__LINKEDIT?+??+??"?0?+???+???+???+?J8-?=?0p

               P+8+8??<?0? 
                           /usr/lib/dyld??"???q???@Q2 

                                                      ?*(??
                                                           `/System/Library/Frameworks/CoreText.framework/Versions/A/CoreText
                                             h@/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
                                        X/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
                    h/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
                    `i@,/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
             hi@?/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
              8/usr/lib/libiconv.2.dylib
                                        8/usr/lib/libSystem.B.dylib
                                                                   8/usr/lib/libresolv.9.dylib&8?,?!)0
                      -     UH??AWAVSPI??I??H??t(H??H?yt+H?H??t"H?9H??L???Z?H??u5?"M??1??/M??t??H????H??uM???E1?H??I?1?L??I?_I?H?[A^A_]?DUH??AWAVSH??8H????I??HH??H9?HG?H??A?LC??1?L??H??H????H??H??tH??H??I?H?M?H?E??1?H?E?H?}?H?M?H???????H?}?uH?E?I?M?H??8[A^A_]?H?u?H??u?e?H?}?謮 f.?f?UH??AWAVSH??8H????I??HH??H9?HG?H??A?LC??1?L??H??H????H??H??tH??H??I?H?M?H?E??1?H?E?H?}?H?M?H???0???H?}?uH?E?I?MH??8[A^A_]?H?u?H??u襜H?}??? f.?f?UH??AWAVSH??8H????I??HH??H9?HG?H??A?LC?? 1?L??H??H????H??H??tH??H??I?H?M?H?E??1?H?E?H?}?H?M?H???p???H?}?uH?E?I?M?H??8[A^A_]?H?u?H??u??H?}??,? f.?f?UH??AVSH??0H??H????I??HH??H9?HG?H???HB?E1?H??H??I??A??I??H??tI?6H??H??H?u?H?E??1?H?M?H?}?H?M?L??L??????H?}?uH?E?I?I?H??0[A^]?H?u?H??u?,?H?}??s? UH??AWAVSH??8H????I??HH??H9?HG?H??A?LC?1?L??H??I????H??H??tI?6H??H??H?u?H?E??1?H?M?H?}?H?M?L??H??????H?}?uH?E?I?M?H??8[A^A_]?H?u?H??u?w?H?}?辫 f.?@UH??AWAVSH??8H????I??HH??H9?HG?H??A?LC??(1?L??H??H????H??H??tH??H??I?H?M?H?E??1?H?E?H?}?H?M?H???@???H?}?uH?E?I?M?H??8[A^A_]?H?u?H??u赙H?}???? f.?f?UH??AWAVSH??8H????I??HH??H9?HG?H??A?LC??1?L??H??H????H??H??tH??H??I?H?M?H?E??1?H?E?H?}?H?M?H??????H?}?uH?E?I?M?H??8[A^A_]?H?u?H??u???H?}??<? f.?f?UH??AVSH??0H??H????I??HH??H9?HG?H???HB?AE1?H??I??I??A??I??H??tI?6H??I??H?u?H?E??1?H?M?H?}?H?M?L??L??????H?}?uH?E?I?IH??0[A^]?H?u?H??u?6?H?}??}? f.?UH??AVSH??0H??H????I??HH??H9?HG?H???HB?A?E1?H??I??I??A??I??H??tI?6H??I??H?u?H?E??1?H?M?H?}?H?M?L??L???????H?}?uH?E?I?I?H??0[A^]?H?u?H??u?v?H?}?轨 f.?UH??AWAVSH??8H????I??HH??H9?HG?H??A?LC?? 1?L??H??H????H??H??tH??H??I?H?M?H?E??1?H?E?H?}?H?M?H???@???H?}?uH?E?I?M?H??8[A^A_]?H?u?H??u赖H?}???? f.?f?UH??AWAVSH??8H????I??HH??H9?HG?H??A?LC??P1?L??H??H????H??H??tH??H??I?H?M?H?E??1?H?E?H?}?H?M?H??????H?}?uH?E?I?M?H??8[A^A_]?H?u?H??u???H?}??<? f.?f?UH??AVSH??0H??H????I??HH??H9?HG?H???HB?A?E1?H??I??I??A??I??H??tI?6H??I??H?u?H?E??1?H?M?H?}?H?M?L??L??????H?}?uH?E?I?I?H??0[A^]?H?u?H??u?6?H?}??}? f.?UH??AWAVSH??8H????I??HH??H9?HG?H??A?LC??P1?L??H??H????H??H??tH??H??I?H?M?H?E??1?H?E?H?}?H?M?H??????H?}?uH?E?I?M?H??8[A^A_]?H?u?H??u?u?H?}?輥 f.?f?UH??AVSH??0H??tuI??H?H?
                                                                  H9?HG?H?HC?H??tI?H?M?H?Eȸ?1?H?E?H?}?H?M??H???_???H?}?uH?E?I?I?H??0[A^]?H?u?H??u?֓H?}??? f.?UH??AWAVSH??8H????I??HH??H9?HG?H??A?LC??1?L??H??H????H??H??tH??H??I?H?M?H?E??1?H?E?H?}?H?M?H??????H?}?uH?E?I?M?H??8[A^A_]?H?u?H??u??H?}??\? f.?f?UH??AWAVSH??8H????I??HH??H9?HG?H??A?LC??01?L??H??H????H??H??tH??H??I?H?M?H?E??1?H?E?H?}?H?M?H???????H?}?uH?E?I?M?H??8[A^A_]?H?u?H??u?U?H?}?蜣 f.?f?UH??AWAVAUATSH??HH??H?}?L?~8H?FXH?E?H?H?E?H?FH?E?H?F H?E?L?n0L??H??H?E??E?J??H?E??9A?M??I?? L??H?u?H?U??ת K??L?{8L?k@L?{HH?CPD?sXD?c\M??t7H?CHH;CP??H?C@H??tH??L??H???S?H?C8H?}?tPH?CH;E?tFH?H?KL?0M???f????}??ؾH?}????I??H???H????H?}??d? H?{`H????H?CpH;CxtYH?H?KpH????
                                                                         HH?KHH?U?H??'

apple:~ apple$

(1) win7 does not support recording gpu;macOS only supports recording FPS with SIP turned off;
(2) I forgot to configure MACOSX_DEPLOYMENT_TARGET in CI, precompiled precord may not work properly on lower versions of macOS

Recording fps on macOS must be invoked as superuser.

Recording fps on macOS must be invoked as superuser.

SIP has been closed. I also use the role of sudo Su to collect FPS data of MacOS, but there is no data output.

Recording fps on macOS must be invoked as superuser.

SIP has been closed. I also use the role of sudo Su to collect FPS data of MacOS, but there is no data output.

You can try to record the fps of other processes, such as chrome's gpu process.

在 macOS 上录制 fps 必须以超级用户身份调用。

SIP 已关闭。我也是用sudo su的角色采集MacOS的FPS数据,但是没有数据输出。

可以尝试记录下其他进程的fps,比如chrome的gpu进程。

Various processes have tried, but there is no data.

image

image

I tried Chrome and it works, but it takes a few seconds to capture the FPS.

precord relies on dtrace to work and currently only traces 2 system calls below:

  • CAMetalLayer:-nextDrawable:entry
  • QuartzCore:CA??Render??Surface??finalize():entry

image

It also works on WindowServer.
图片

我尝试了 Chrome 并且它可以工作,但捕获 FPS 需要几秒钟。

precord 依赖于dtrace工作,目前仅跟踪以下 2 个系统调用:

  • CAMetalLayer:-nextDrawable:entry
  • QuartzCore:CA??Render??Surface??finalize():entry

There is FPS data output, but it is too slow and there is little data.

image

image

image

It also works on WindowServer.

Precord cannot be called in the code, and an error is output. I want to see what will be output in the code call, and how to use it?

image

There is FPS data output, but it is too slow

Yes, but there is currently no other way to get FPS on macOS. You can use the --skip parameter to filter the results for the first few times

and there is little data.

If the app doesn't perform a redraw, there will be no fps.

precord uses raw mode to support interactive mode, You can use the following script to get the data:

import subprocess
import os

p = subprocess.Popen("precord -c sys_gpu", stdout=subprocess.PIPE, shell=True)

while True:
  line = p.stdout.readline()
  if line != '':
    os.write(1, line)
  else:
    break

The best way is to use the precord-core api.

precord使用原始模式支持交互模式,您可以使用以下脚本获取数据:

import subprocess
import os

p = subprocess.Popen("precord -c sys_gpu", stdout=subprocess.PIPE, shell=True)

while True:
  line = p.stdout.readline()
  if line != '':
    os.write(1, line)
  else:
    break

最好的方法是使用precord-coreapi。

precord-coreapi。

Ha ha ~ ~ great!!! I have always wanted to ask how to use precord coreapi. Is there a specific instruction document? How to call precord coreapi in the code?I can only use python.

image

Ha ha ~ ~ great!!! I have always wanted to ask how to use precord coreapi. Is there a specific instruction document? How to call precord coreapi in the code?I can only use python.

precord-core is a rust library, unfortunately it cannot be called directly from python, a possible solution is to export the C interface and compile it into a dynamic library used by python.

哈哈~~好棒!!!一直想问precord coreapi怎么用。有具体的说明文件吗?如何在代码中调用precord coreapi?我只能用python。

precord-core是一个rust库,可惜不能直接从python调用,一个可能的解决办法是导出C接口,编译成python使用的动态库。

Continue to fight for the world of Python!!!

I think if the interval time is set to 0.1 seconds, or can be freely set to 0.1 seconds, it can help everyone quickly skip some data at the beginning, which can ensure that the data can be read quickly. Now the interval seems to be fixed at 1 second by default, which is too long.

https://blog.csdn.net/wowotuo/article/details/108913397

image

v0.5.11 is released, interactive mode is optional, now you can use this script to get data:

import os

r = os.popen("precord -c sys_gpu -n 2").read()
print(r)

image

I think if the interval time is set to 0.1 seconds, or can be freely set to 0.1 seconds, it can help everyone quickly skip some data at the beginning, which can ensure that the data can be read quickly. Now the interval seems to be fixed at 1 second by default, which is too long.

We can't do this, the time slice is too short to get the correct cpu usage.

v0.5.11 is released, interactive mode is optional, now you can use this script to get data:

import os

r = os.popen("precord -c sys_gpu -n 2").read()
print(r)
image

I doubt that precord can't use relative paths, because you use the path in the environment variable, and I use the desktop path, which is not very flexible.

image

I doubt that precord can't use relative paths, because you use the path in the environment variable, and I use the desktop path, which is not very flexible.

Did you try version 0.5.11?

I doubt that precord can't use relative paths, because you use the path in the environment variable, and I use the desktop path, which is not very flexible.

Did you try version 0.5.11?

yeah, i'm using the latest version.

Please try version 0.5.12~, it works well together with pycharm now.

image

Please try version 0.5.12~, it works well together with pycharm now.

image

I can try version 0.5.12 on MacOS next Monday, because the computer is not around for the time being. Now I debug this data on Windows 10, but I find that reading the data on the command line takes up too much CPU, 10% of the CPU, and there is no good way to separate these data, such as dict or JSON format data format. Therefore, I think it is more practical to add the output format of data on the command line and add the data format of dict or JSON format.

image

You can use the -o parameter, e.g. -o result.json, then read the output file.

我怀疑precord不能使用相对路径,因为你使用环境变量中的路径,而我使用桌面路径,不是很灵活。

您尝试过 0.5.11 版吗?

是的,我正在使用最新版本。

Problem solved

image