Search Unity

  1. Curious about what's going to be in 2020.1? Have a look at the 2020.1 beta blog post.
    Dismiss Notice
  2. Want to see 2020.1b in action? Sign up for our Beta 2020.1 Overview Webinar on April 20th for a live presentation from our evangelists and a Q&A session with guests from R&D.
    Dismiss Notice
  3. Interested in giving us feedback? Join our online research interviews on a broad range of topics and share your insights with us.
    Dismiss Notice
  4. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Profiler native plug-in API

Discussion in '2018.2 Beta' started by buFFalo94, Apr 19, 2018.

  1. buFFalo94

    buFFalo94

    Joined:
    Sep 14, 2015
    Posts:
    216
    This come from 2018.2 release note
    Can I know more about the API?
    Note : there's nothing about it in the docs.
     
  2. SebastianHjorth

    SebastianHjorth

    Unity Technologies

    Joined:
    Feb 13, 2018
    Posts:
    6
    Hi! So far the API is internal only, but it will allow 3rd party profilers to integrate with our profiling framework. They will receive the same data as our internal profiler and are able to display it because of that.
     
    SugoiDev likes this.
  3. buFFalo94

    buFFalo94

    Joined:
    Sep 14, 2015
    Posts:
    216
    Interesting:)
     
  4. alexeyzakharov

    alexeyzakharov

    Unity Technologies

    Joined:
    Jul 2, 2014
    Posts:
    362
    Draft documentation is available at https://docs.google.com/document/d/1ldq6c6wKfYT9VFCzubTUV1ZVgc1-EWxU7CaX5Ik1v6Y

    The header itself can be found in the Unity install folder. We are working on the public example.
    Internally we switched one of platform profilers to use it and planning to do that for all platforms.
    At the same time it might be useful for anyone who wants to grab events when they occur.
    There are some known issues we are fixing atm:
    1. GC.Alloc is not grabbed.
    2. Profiler.BeginSample only grabbed with profiler enabled.
     
  5. buFFalo94

    buFFalo94

    Joined:
    Sep 14, 2015
    Posts:
    216
    Thank you i was really want something like this but in the doc there's nothing about getting useful data like in the Editor Profiler you just show how we can register callbacks...IMHO the doc is useless sincerely
     
    Last edited: May 5, 2018
  6. alexeyzakharov

    alexeyzakharov

    Unity Technologies

    Joined:
    Jul 2, 2014
    Posts:
    362
    The API is for collecting the data.
    We are working on the plugin demo which explains what can be collected.

    What to do with an event is up to the collector. Profiler does postprocessing and aggregation of the events received through these callbacks to built a merged/filtered representation. As was said before this is primarily for the integration with system profilers which can then display Unity events on top of OS/CPU and other data.
     
  7. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    4,643
  8. buFFalo94

    buFFalo94

    Joined:
    Sep 14, 2015
    Posts:
    216
  9. alexeyzakharov

    alexeyzakharov

    Unity Technologies

    Joined:
    Jul 2, 2014
    Posts:
    362
    Only some of that stats can be collected. Right now you can get "calls count" value for almost any profiler event (e.g. Material.SetPass, Camera.Render, MeshSkinning.Render or anything you see in the profiler except samples generated by Profiler.BeginSample). For quite some time calls count information is available in development players through Profiling.Recorder API and we use it internally in performance tests. You don't need Plugin API for this.

    Stats like vertices, meshes count are not exposed yet. Once ready we'll expose C# API similar to Recorder to get an integral counter value.
     
  10. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,074
    buFFalo94 likes this.
unityunity