Giter Site home page Giter Site logo

Comments (23)

LRF520 avatar LRF520 commented on July 21, 2024 1

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

您尝试过 0.5.11 版吗?

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

Problem solved

image

from precord.

xiaopengli89 avatar xiaopengli89 commented on July 21, 2024

(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

from precord.

xiaopengli89 avatar xiaopengli89 commented on July 21, 2024

Recording fps on macOS must be invoked as superuser.

from precord.

LRF520 avatar LRF520 commented on July 21, 2024

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.

from precord.

xiaopengli89 avatar xiaopengli89 commented on July 21, 2024

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.

from precord.

LRF520 avatar LRF520 commented on July 21, 2024

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

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

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

Various processes have tried, but there is no data.

image

from precord.

xiaopengli89 avatar xiaopengli89 commented on July 21, 2024

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

from precord.

xiaopengli89 avatar xiaopengli89 commented on July 21, 2024

image

It also works on WindowServer.

from precord.

LRF520 avatar LRF520 commented on July 21, 2024
图片

我尝试了 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

from precord.

LRF520 avatar LRF520 commented on July 21, 2024
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

from precord.

xiaopengli89 avatar xiaopengli89 commented on July 21, 2024

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.

from precord.

xiaopengli89 avatar xiaopengli89 commented on July 21, 2024

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.

from precord.

LRF520 avatar LRF520 commented on July 21, 2024

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

from precord.

xiaopengli89 avatar xiaopengli89 commented on July 21, 2024

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.

from precord.

LRF520 avatar LRF520 commented on July 21, 2024

哈哈~~好棒!!!一直想问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

from precord.

xiaopengli89 avatar xiaopengli89 commented on July 21, 2024

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

from precord.

xiaopengli89 avatar xiaopengli89 commented on July 21, 2024

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.

from precord.

LRF520 avatar LRF520 commented on July 21, 2024

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

from precord.

xiaopengli89 avatar xiaopengli89 commented on July 21, 2024

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?

from precord.

LRF520 avatar LRF520 commented on July 21, 2024

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.

from precord.

xiaopengli89 avatar xiaopengli89 commented on July 21, 2024

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

image

from precord.

LRF520 avatar LRF520 commented on July 21, 2024

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

from precord.

xiaopengli89 avatar xiaopengli89 commented on July 21, 2024

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

from precord.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.