Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    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:
    273
    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:
    273
    Interesting:)
     
  4. alexeyzakharov

    alexeyzakharov

    Joined:
    Jul 2, 2014
    Posts:
    508
    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:
    273
    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

    Joined:
    Jul 2, 2014
    Posts:
    508
    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:
    6,618
  8. buFFalo94

    buFFalo94

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

    alexeyzakharov

    Joined:
    Jul 2, 2014
    Posts:
    508
    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,167
    buFFalo94 likes this.