Thread-based local event profiling with performance and scaling analysis
By integrating the profiling system in a multi-threaded system, storing event data and generating graphical output, it solves the problem of low efficiency in event data collection and analysis, achieves high-accuracy and efficient analysis of multi-threaded events, and helps optimize code performance.
Patent Information
- Application Number
- CN202410397927.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-04-05
- Filing Date
- 2024-04-03
- Publication Date
- 2024-10-15
Smart Images

Figure CN118779124A_ABST
Abstract
Description
CROSS-REFERENCE TO RELATED APPLICATION(S)
[0001] This application claims priority to U.S. Provisional Patent Application No. 63 / 457,335, filed on April 5, 2023, and entitled “THREAD LOCAL EVENT BASED PROFILING WITH PERFORMANCE AND SCALING ANALYSIS,” which is incorporated herein by reference in its entirety. Technical Field
[0002] The present disclosure relates to systems and methods for collecting and analyzing event data in a multithreaded system with increased efficiency in processing resources. Background Art
[0003] A computing system may include one or more computing nodes configured to execute one or more processes. For example, a process generated by a computing system may include rendering a video or generating a model from a set of input data.
[0004] When executing such a process, a series of events may be executed. An event may include a processing task being performed using one or more computing resources (e.g., a processor) in a computing system. Each event may have a start time and an end time, and may be part of a thread.
[0005] A thread may include a series of related events when performing one or more processing tasks. A thread may be a self-contained sequence of instructions that may be executed in parallel with other threads that are part of the same root process. An event that is part of a thread may be initiated in response to the completion of another event in the thread. For example, the completion of a first event in a thread may allow a second event in the thread to be initiated. Summary of the invention
[0006] The present embodiment relates to collecting and analyzing event data in a multithreaded system with increased efficiency in processing resources. A profiling system can be integrated with a threaded system to collect cache line sized event data into a local ring buffer. The ring buffer can be aligned and sized to fit into a cache (such as a CPU L2 cache or L1 cache). The threaded system can store events for various job groups and distribute items to worker threads. After collecting event data, the start and end of the event can be synchronized to more easily analyze and graphically display the event data. In addition, various outputs (e.g., heat maps) can be generated to illustrate various aspects of events and threads, such as the scope of each event / thread.
[0007] In a first example embodiment, a computer-implemented method is provided. The computer-implemented method may include collecting data associated with each event being executed by a computing system at a particular time instance. Each event may be part of a thread of associated events. The computer-implemented method may also include generating a circular buffer for each thread specifying each event being executed at the particular time instance. The computer-implemented method may also include storing data associated with each event of the thread in the circular buffer. The computer-implemented method may also include retrieving stored data from one or more circular buffers. The computer-implemented method may also include generating an output representing the stored data from the circular buffer. The computer-implemented method may also include causing display of the output.
[0008] In some examples, the ring buffer is stored per thread event with a size corresponding to a CPU L2 cache or L1 cache.
[0009] In some examples, the size of the event data is 64 bytes.
[0010] In some examples, the data collected for each event includes any of: a timestamp, an event type, and one or more type-specific parameters.
[0011] In some examples, the scope of each event is derived based on the timing of each event being executed by the aggregate.
[0012] In some examples, the graphical representation includes a heat map.
[0013] In another example embodiment, a system is provided. The system may include one or more processors and one or more non-transitory processor-readable storage devices. The storage device may include instructions that, when executed by the one or more processors, cause the one or more processors to perform operations, the operations including collecting data associated with each event being executed at a particular time instance. Each event may be part of a thread of associated events. The operations may also include generating a buffer for each thread specifying each event being executed at the particular time instance. The operations may also include generating an output representing the data from the buffer and causing display of the output.
[0014] In some examples, the operations further include storing data associated with each event of the thread in the buffer; and retrieving the stored data from the buffer, wherein the output is generated based on the stored data of the buffer.
[0015] In some examples, the buffer includes a ring buffer.
[0016] In some examples, the ring buffer is stored per thread event with a size corresponding to a CPU L2 cache or L1 cache.
[0017] In some examples, the size of the event data is 64 bytes.
[0018] In some examples, the data collected for each event includes any of: a timestamp, an event type, and one or more type-specific parameters.
[0019] In some examples, the scope of each event is derived based on the timing of each event being executed by the aggregate.
[0020] In some examples, the graphical representation includes a heat map.
[0021] In another example embodiment, one or more non-transitory computer-readable media including instructions are provided, which, when executed by one or more processors, cause the one or more processors to perform operations. The operations may include collecting data related to each event being executed by a computing system at a specific time instance. Each event may be part of a thread of associated events. The operations may also include generating a circular buffer for each thread specifying each event being executed at the specific time instance. The operations may also include storing data related to each event of the thread in the circular buffer. The operations may also include retrieving stored data from one or more circular buffers. The operations may also include generating an output representing the stored data from the circular buffer. The operations may also include causing display of the output.
[0022] In some examples, the ring buffer is stored per thread event with a size corresponding to a CPU L2 cache or L1 cache.
[0023] In some examples, the size of the event data is 64 bytes.
[0024] In some examples, the data collected for each event includes any of: a timestamp, an event type, and one or more type-specific parameters.
[0025] In some examples, the scope of each event is derived based on the timing of each event being executed by the aggregate.
[0026] In some examples, the graphical representation includes a heat map.
[0027] Additional objects and advantages of the disclosed embodiments will be explained in part in the following description, and in part will be clear from the description, or can be understood by the practice of the disclosed embodiments. The objects and advantages of the disclosed embodiments will be realized and obtained by means of the elements and combinations particularly pointed out in the appended claims.
[0028] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosed embodiments, as claimed. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate various exemplary embodiments and, together with the description, serve to explain the principles of the disclosed embodiments.
[0030] Figure 1A is an illustration of an example set of threads in executing a process according to certain aspects described herein.
[0031] Figure 1B is a first illustration of a first set of snapshots of events as part of multiple threads in accordance with certain aspects described herein.
[0032] Figure 1C is a second illustration of a first set of snapshots of events as part of a plurality of threads according to certain aspects described herein.
[0033] Figure 1D is an illustration of a second set of snapshots of events as part of multiple threads according to certain aspects described herein.
[0034] Figure 2 Illustration of example patterns identified in a profiler profiling multiple events in accordance with certain aspects described herein.
[0035] Figure 3 An example computing system is illustrated in accordance with certain aspects described herein.
[0036] Figure 4A A first example ring buffer is illustrated in accordance with certain aspects described herein.
[0037] Figure 4B A second example ring buffer is illustrated in accordance with certain aspects described herein.
[0038] Figure 5 is an example series of captured events according to certain aspects described herein.
[0039] Figure 6 is an example UI output according to certain aspects described herein.
[0040] Figure 7is an example method for collecting and generating graphical representations of event data in a multi-threaded system according to certain aspects described herein.
[0041] Figure 8 is an illustration of an example networked system in accordance with certain aspects described herein.
[0042] Fig. 9 is an illustration of an example computer system in accordance with certain aspects described herein. DETAILED DESCRIPTION
[0043] A computing system may include one or more computing nodes configured to execute one or more processes. For example, a process generated by a computing system may include rendering a three-dimensional (3D) video or generating a model from a set of input data.
[0044] When executing such a process, a series of events may be performed. An event may include a processing task being performed using one or more computing resources (eg, processors) in a computing system.
[0045] A thread may include a series of related events when executing a process. A thread may be a self-contained sequence of instructions that may be executed in parallel with other threads that are part of the same root process. An event that is part of a thread may be initiated in response to the completion of another event in the thread. For example, the completion of a first event in a thread may allow a second event in the thread to be started.
[0046] Figure 1A FIG. 1 is a diagram 100A of an example set of threads 102A-C when executing a process. Figure 1A As shown in , a thread (e.g., 102A) may include a series of events (e.g., event 1 104A, event 2 104B, event 3 104C). The thread of events may be time-based, where the completion of processing a first event (e.g., event 1 104A) may initiate processing of a second event (e.g., event 2 104B). In addition, each event may include a processing duration, for example, as shown by the width of each event (104A-J).
[0047] In addition, multiple independent threads of events can be processed when executing a process. For example, threads 102A, 102B, and 102C can each be processed as part of a multithreaded system. Each thread can execute events that are part of a separate thread. For example, thread 2 102B can include a series of events (e.g., event 4 104D, event 5 104E, event 6 104F), and thread 3 102C can include another series of events (e.g., event 6 104H, event 7 104H, event 8 104I, event 9 104J).
[0048] Multithreading can include CPU features that allow two or more instruction threads to execute independently while sharing the same process resources. In addition, multithreading can allow multiple concurrent tasks to be executed in a single process.
[0049] For multithreaded applications, a pattern can be included where the control thread triggers actions on multiple worker threads and is notified when the results of these work items (jobs) are available. For example, the application can display a button in a dialog box. When the user clicks the displayed button, the UI thread can start an asynchronous action or a set of parallelized actions on a loop running on a worker thread.
[0050] In such a multithreaded processing system, a large number of events may be executed in a particular duration. Among the large number of events, one or more events may be implemented inefficiently (e.g., the event may take longer than necessary or expected to be processed by the computing resources, the event may take more than the expected amount of computing resources to process). In many cases, it is desirable to identify such events and modify various aspects of the event to improve the efficiency of executing the event.
[0051] In many instances, a profiler can be implemented to process multithreaded systems and identify aspects of events being processed during a duration. The profiler can obtain a time-based profile of events (and threads of events) being executed at a given time instance, which can be represented as a snapshot of the call stack of each thread.
[0052] Figure 1B FIG. 100B is a diagram of a first set of snapshots 110A-C of events that are part of multiple threads. Figure 1B As shown in , when event 1104A, event 4104D, and event 7104G are each being executed in different threads 102A-C, a first snapshot 110A can be taken at a first time. In addition, when event 2104B and event 5104E are each being executed in different threads 102A-B, a second snapshot 110B can be taken at a second time. Similarly, when event 3104C and event 6104F are each being executed in different threads 102A-B, a third snapshot 110C can be taken at a third time.
[0053] However, many profilers periodically take snapshots of all events being executed during a period of time. But even with high periodicity, there is a possibility that events may be missed. For example, many profilers are unable to take snapshots with a periodicity that can capture all events being executed during a period of time. For example, if a profiler captures a snapshot every 10 milliseconds (ms), an event that starts and ends within 5 ms may never be captured by the profiler.
[0054] For example, Figure 1B As shown in FIG. 1 , a portion of the events (e.g., event 8104H, event 9104I, and event 10104J) are not captured in any of the snapshots 110A-C. The failure to capture every event may be due, at least in part, to the periodicity of the snapshots being taken by the profiler. Figure 1C In FIG. 1 , a series of event record instances (eg, 114A-C) indicate a record of the beginning and / or end of each event 104A-J or other incidents related to that event.
[0055] Figure 1D FIG. 100D is a diagram of a second set of snapshots 112A-F of events that are part of multiple threads. Figure 1D As shown in , the second set of snapshots 112A-F may have a greater periodicity than the first set of snapshots 110A-C. In addition, each of the second set of snapshots 112A-F may capture each event 104A-J so that information for each event may be stored for further analysis as described herein.
[0056] Many profilers can use a large amount of computing resources to process and obtain information for each thread, especially in systems with a large number of threads and / or events being executed. The increased amount of computing resources used to implement the profiler may be inefficient and may limit the maximum possible periodicity of snapshots of captured threads. Such profilers may have a huge performance penalty and may be a tool for developers only. Therefore, the time-based sampling frequency may be too low to analyze complex distributed threaded workloads. There is a need for a tool that can calculate range-based scaling in a meaningful way.
[0057] The present embodiment relates to collecting and analyzing event data in a multithreaded system with increased efficiency in processing resources. A profiling system can be integrated with a threaded system to collect cache line sized event data into a local ring buffer. The ring buffer can be aligned and sized to fit into a cache (such as a CPU L2 cache or L1 cache). The threaded system can store events for various job groups and distribute items to worker threads. After collecting event data, the start and end of the event can be synchronized to more easily analyze and graphically display the event data. In addition, various outputs (e.g., heat maps) can be generated to illustrate various aspects of events and threads, such as the scope of each event / thread.
[0058] A range can include a period of time with a start and end stamp and an associated name. For the purpose of profiling code, the name can include a function name, the name of an operation, or the name of an object being processed.
[0059] This embodiment can allow to identify events of multiple threads with higher accuracy and efficiency.The information obtained from the snapshot can identify the start / end time of each event, the thread associated with each event, and / or other parameters associated with each event.
[0060] Figure 2 Figure 1 shows example patterns identified in a profiler profiling multiple events. Figure 2 As shown in , a view of a profiler 200 may depict a list 202 of profiled threads, a timeline 204, and a series of events 208A-B. The grouping of events may be part of a trace 206.
[0061] like Figure 2 As shown in , a timeline 204 can be displayed below the window title. The left area can include a list 202 of profiled threads. For example, each of the icons below the timeline can represent a profiled event. For example, the scope of a rendering kernel (RSENC_DLPreTrace) being executed on the control thread can be shown as a trace 206.
[0062] Additionally, a job group may be created (indicated by the PUSH_JOB_GROUP_CREATE event). Jobs may be queued on worker threads (PUSH_JOB_GROUP_ENQUEUE_FIFO). Additionally, worker threads may be woken up (THREAD_WAKE_UP) and may get their jobs and run payloads (RUN_WORKER_BEGIN).
[0063] In general, the profiling system may perform three main steps: recording, collecting, and analyzing. Each of the events mentioned may be recorded by the profiling system in a thread-local circular buffer. The thread may collect thread-local events and merge them into a structure for further analysis or display. This may occur in a periodic manner, but in some instances, the caller may choose to collect all available data after the profile is run, without any additional threads and without any periodicity. After collection, the data may be displayed (e.g., as Figure 2 ), written as text, csv, binary, sent over the internet, or analyzed in a variety of ways. Periodic collection may be optional, and analysis may be performed independently.
[0064] Each event may have a timestamp with a resolution in the nanosecond range. This may be provided by a CPU counter or interrupt, but for profiling purposes it may be an arbitrary value that associates the profiling event with an action of interest, or may refer to the state of the system being profiled. In any case, no periodic snapshots may be included, and the possibility of events on different threads sharing the same timestamp may be impossible (when the timestamp provider has a high resolution).
[0065] Figure 3 An example computing system 300 is shown. The computing system 300 may include one or more interconnected computing nodes configured to perform the processing described herein. Figure 3 As shown in , computing system 300 may include threading system 302. Threading system 302 may generate and execute events as part of one or more threads as described herein. Threading system 302 may also generate data specific to each event, such as event start / stop time, event type, and / or type-specific parameters.
[0066] The computing system 300 may also include a collection system 304. The collection system 304 may periodically collect data related to events and threads being executed at a certain time instance. The collection system 304 may generate stored event data 308, which may be subsequently processed as described herein. For example, the collection system 304 may generate a cacheable ring buffer 310.
[0067] Computing system 300 may also include a profile event analysis system 306. Profile event analysis system 306 may process stored event data 308 captured by collection system 304 and may generate insights into events / threads in the stored event data.
[0068] The profiling event analysis system 306 may include an efficiency calculation subsystem 312. The efficiency calculation subsystem 312 may derive one or more efficiency characteristics of the threaded system. For example, the efficiency of the threaded system and the duration of the multithreaded payload may be calculated via the start and end stamps of the group event and the stamps for execution on the worker thread. In addition, details such as latency, idle or sleep time of the worker thread may be evaluated via the efficiency calculation subsystem 312.
[0069] The profiling event analysis system 306 may also include a scope derivation subsystem 314. The scope derivation subsystem 314 may calculate the scope of each event and thread included in the stored event data. For scopes of interest, the amount and efficiency of multithreaded work may be recorded. In addition, scopes of the same type may be accumulated to calculate their overall timing. The scope of each event / thread may indicate the efficiency of each event / thread.
[0070] The profiling event analysis system 306 may also include a user interface (UI) generation subsystem 316. The UI generation subsystem may generate a UI representation of the stored event data, efficiency calculations, and / or scope of each event / thread. Example graphical representations may include heat maps, tables, charts, etc.
[0071] Once the data is collected and combined, there are more ways to do it than just displaying events in a timeline or heat map. Based on the scope data and events from the threaded system, a lot of useful data can be derived. For example, the stored data can be used to calculate any of the amount of time that is only single-threaded (on the control thread), the amount of multi-threaded work, the overhead of the threaded system, and / or the amount of sleep / unemployment of worker threads. Using this data, it can be determined to what extent multi-threading in the profiled code should speed up the application. For example, a method that performs a lot of single-threaded work on the control thread may only get a maximum of 4 times the speedup, even if it uses 32 worker threads in some parts. In addition, developers can compare this value with the effectively measured speedup to judge the effectiveness of the code. By aggregating the profiled data by scope, summaries as text and csv can be generated for developers.
[0072] Comparing summary data of a profile running with 1 thread to a profile running with N threads can deliver effective scaling (speedup) for each scope. For example, developers can focus on code / scopes that are not properly scaled and have the greatest impact.
[0073] In some instances, profiling may have little performance impact, being enabled in an application build to collect information about what happened before the application crashed (or froze). As already mentioned, periodic collection may be optional. Events in the thread-local ring buffer may be enough information about past actions. This may not include a specific profiling scope, but may include general information about threaded operation along with crash logs to be able to perform an educated guess about what went wrong and why.
[0074] Whenever a user can create a complex setup, the performance implications can be completely hard to judge. Profiling support can help with this. For example, in a scene graph, each object can represent an extent, and the scene graph is executed to create the profiled geometry. The same can apply to node systems or other complex systems. Once the system has been profiled and data has been collected (similar to the developer view aggregation of extents), displaying it as a heat map or in some cases even a timeline view can help users improve the performance of their setup or understand where bottlenecks exist.
[0075] Compared to some time profiling with periodic snapshots that developers frequently use, there may be many tools for it, and it has its use case when analyzing single-threaded code that runs for a longer time. In this case, a huge performance impact is often tolerable because the observations usually do not affect the behavior of the observable object too much (which causes the results to be distorted). This technique may be most successful when there are obvious hot spots. The picture may be different when running in a multithreaded context. It may be ideal to use as many threads as possible, so any time-consuming periodic profiling may result in pre-scheduling by the OS scheduler and may slow down the multithreaded code much more than what happens in the single-threaded case. Due to the periodic nature, the sampling resolution may be too low to observe the relationship in the multithreaded context, and even if it is possible to increase the sampling frequency to the microsecond range (which may be difficult due to operating system limitations), the overhead involved may make such an effort useless. In addition, if the resolution of the snapshot is too low (and this is the case when tens of thousands or more work items are executed per second), there may be no way to understand the relationship between the sampled fragments. For example, it may be difficult to understand which thread triggered another thread, why it is waiting, why the overall scaling and performance is much worse than expected. For developers, using traditional profiling to find bottlenecks in complex multithreaded code can be futile, trying to use this approach in the context of an application will first cause unwanted slowdowns for users, and it will not help at all in complex settings. Collection Overview
[0076] As described above, the profiling system can be integrated with the threading system to capture data related to events. The profiling system can capture event start / end times, corresponding threads of events, and other parameters. Per-thread events (with cache line size) can be stored in a local ring buffer with queue consumer and producer attributes. The ring buffer can be aligned and sized to easily fit into the CPU L2 cache and preferably into the L1 cache.
[0077] Figure 4A A first example ring buffer 400A is shown. Figure 4AAs shown in , a ring buffer 400A may include a data structure storing a number of elements 402A-H. Each element may point to an event captured by a profiling system. For example, events and event data may be stored in a local ring buffer with queue consumer and producer attributes. The ring buffer may be aligned and sized to easily fit into a CPU L2, and in some cases into an L1 cache.
[0078] The ring buffer may also include a write pointer 404 and a read pointer 406. The write pointer 404 may serve as the head of the buffer, while the read pointer 406 may serve as the tail of the buffer. The positions of the pointers 404, 406 relative to each other may specify the available number of elements in the buffer. For example, Figure 4A As shown in , the positions of write buffer 404 and read buffer 406 may specify available elements 402E-G in buffer 400 as available.
[0079] The ring buffer may maintain a ring structure. For example, if a new element is consumed from the ring buffer, the write pointer may point to the next element as the new head of the buffer, and the new element may then be inserted in the empty space. As elements are consumed, the pointer to the first element may rotate around the ring buffer. The buffer may include a first-in, first-out (FIFO) buffer.
[0080] Figure 4B is a second example ring buffer 400B. Figure 4B As shown in , a series of elements 408A-H can be part of a circular buffer 400B. The buffer can start empty, and the first element (e.g., 408A) can be written to any part of the buffer 400B. Subsequently, as the profiler captures data related to the event / thread, more elements can be added to the buffer.
[0081] Profiling events can include a CPU timestamp, event type, and type-specific customization parameters (e.g., job group, code location, nesting level, worker thread index, number of jobs, pointers to resources). The threaded system can store events for job groups (e.g., parallel for loops), distributing items to worker threads. For areas of interest (e.g., modeling kernels, nodes), range events with start, end, and name (and optional data) can be stored. Each element in a double-ended queue can have an index. By comparing the indexes, the samples collected by each thread can be processed to determine if there are any gaps in the thread that indicate whether data (e.g., events) are missing. The profiling system can enter an idle or sleep state after processing in order to limit interference with the threaded system.
[0082] The collecting thread may look at the memory copy of the data or change the pointer. An event may include a 64-byte cache line. The cache line may further be written to the CPU. The size of the cache may be scalable to include multiple entries (e.g., 1000, 2000 entries). The size of the ring buffer may be modified based on the CPU architecture to capture the most information while also fitting within the cache. For example, a profiling system may collect 1000 threads at 1000Hz, which may result in data being collected for 1,000,000 events per second with minimal interference.
[0083] Whenever possible, events can be coalesced and later combined for analysis (e.g., one range event instead of separate start and end events) to improve CPU cache utilization. Additionally, the profiling thread can collect events from all participating worker threads without any locking.
[0084] Figure 5 is an example series of captured events 500. Figure 5 As shown in, one or more captured events 402A-B can be captured at a specific time instance. In addition, the events captured at a certain time instance can capture information from a threaded system or other processes related to the event / thread being executed at the specific time instance.
[0085] For example, Figure 5 As shown in , a first set of captured events 502A may illustrate events being executed at a first time instance, such as event 1 104A, event 5 104E, and event 7 104G. In addition, data associated with each event may be captured, such as CPU timestamp data 504A-C, event type data 506A-C, and type-specific parameters 508A-C.
[0086] In addition, the second set of captured events 502B may include information at a second time instance, where data related to event 2 104B and event 8 104H may be captured. Data related to each event in the second time instance may be captured, such as CPU timestamp data 504D-E, event type data 506D-E, and type-specific parameters 508D-E. The data captured in each captured event may be aggregated and processed to derive insights into the event / thread, as described herein. Profiling Event Analysis
[0087] After collection, the individual start and end events from the merged events can be synthesized (for simpler analysis and graphical display). Profiling Event analysis can be separate from the creation and collection of event data. In addition, analysis can be customized depending on the target audience or parameters specific to each computing system. For example, analysis can be customized to calculate the cumulative running time of a kernel, the latency between the start and response of an event, the number of events in a time frame, etc.
[0088] The efficiency of the threaded system and the duration of the multithreaded payload can be calculated via the start and end stamps of the group event and the stamps executed on the worker thread. In addition, details such as the latency, idle or sleep time of the worker thread can also be derived and evaluated. In many instances, an operator or developer can see whether the algorithm is scaling to a set of specified metrics. This can be done by first running the code single-threaded on one or more cores and then running the code multi-threaded. The acceleration can be many times faster. The workload can also be checked to determine whether it is large enough for a specific metric. For example, if most of the time is wasted on idle or general overhead, the workload of the thread may be larger. Developers can also see if the problem can be fully parallelized. For example, if there is no acceleration about more cores / threads, it may make more sense to invest the parallelization work in other tasks.
[0089] For the scope of interest, the amount and efficiency of multithreaded work can be recorded. In addition, scopes of the same type can be accumulated to calculate their overall timing. Based on the timeline of the control thread and the utilization of the worker thread, the expected scaling can be calculated. The same code sequence can be run with a worker thread, which allows the actual scaling of the scope to be calculated. Users (e.g., developers) can review and fix code scopes that do not scale linearly. For example, single-threaded performance can be compared with multi-threaded performance. The code can then be run single-threaded and then multi-threaded to compare the speedup and number of threads.
[0090] The analyzed event data can be represented in a UI output. Example UI outputs can include a heat map or table. For example, a heat map can illustrate how much cost (e.g., how much computing resources) is being used for each event and thread. The diagram can be used to determine whether an event is inefficient and whether it can be updated / modified.
[0091] A heat map may illustrate the energy used for each event, such as identifying specific tables that are resource intensive. Another example output is to illustrate scaling kernels at launch. The output may illustrate what the kernel is doing and how the kernel is scaling.
[0092] Another example graphical representation of the event flow may include a traditional profile. Such a representation may illustrate when each thread begins to do work on a microsecond or nanosecond level. Such a representation may illustrate how much actual work is being done on a thread due to high efficiency and overhead and the collected single thread time.
[0093] Figure 6 600. UI output 600 can illustrate various aspects of events captured by the profiling system in the captured events and processed by the profiling event analysis system. UI output 600 includes event data 602A-B, scope data 604A-B, and thread duration and payload data 606A-B for each event (e.g., events 1 and 2). UI output 600 can be used to determine inefficient events or threads. In addition, remediation can be performed based on such insights, such as modifying the code of the event to make it less resource intensive.
[0094] Figure 7 is an example method for collecting and generating a graphical representation of event data in a multithreaded system. At 702, the method may include collecting data related to each event being executed by a computing system at a particular time instance. Each event may be part of a thread of associated events. In some examples, the data collected for each event includes any of the following: a CPU timestamp, an event type, and one or more type-specific parameters.
[0095] At 704, the method may include generating a circular buffer specifying each event being executed at a particular time instance. In some examples, the circular buffer is stored per thread event in a size corresponding to a CPU L2 cache or L1 cache. In some examples, the size of the circular buffer is 74 bytes.
[0096] At 706, the method may include storing data related to the events in the thread in a circular buffer. At 708, the method may include processing the data stored in the circular buffer to derive a scope for each event. In some examples, the scope for each event is derived based on the timing of each event being executed by the aggregation.
[0097] At 708, the method may include retrieving stored data from one or more ring buffers.
[0098] At 710, the method may include generating an output representing the stored data from the one or more circular buffers. In some examples, the graphical representation includes a heat map. At 712, the method may include causing display of the output.
[0099] In another example, a system is provided. The system may include one or more processors and one or more non-transitory processor-readable storage devices including instructions that, when executed by the one or more processors, cause the one or more processors to perform operations. The operations may include collecting data related to one or more events being performed at a certain time instance. The operations may also include generating a graphical representation of the collected data.
[0100] In another example embodiment, one or more non-transitory computer-readable media are described. The one or more non-transitory computer-readable media may include instructions that, when executed by one or more processors, cause the one or more processors to perform operations according to any of the embodiments as described herein. Network Example
[0101] Figure 8 An example of a networked computing arrangement that may be utilized herein is shown in . Computer 802 may be any number of kinds of computers, alone or in combination, such as those included with the camera itself, the light source itself, and / or another computer arrangement that communicates with the camera and / or light-computer components, and in some examples, may be a stage motor and / or camera lens motor, including but not limited to a laptop, desktop, tablet, tablet phone, smartphone, or any other kind of device for processing and transmitting digitized data.
[0102] Return to Figure 8 , the computer resources of any aspect of the system may reside on the network 820 in a networked or distributed format. In some examples, the transmission may be performed through a wired connection 812. In some examples, the transmission may be through a network such as the Internet 820 to a back-end server computer 830 and an associated data storage device 832. In some examples, data storage, analysis, and / or processing may be separated between the local computer 802 and the back-end computing system 830. The networked computer resources 830 may allow the utilization of more data processing capabilities than may otherwise be available at the local computer 802. In this way, the processing and / or storage of image data may be offloaded to computing resources available on the network. In some examples, the networked computer resources 830 may be virtual machines in a cloud infrastructure. In some examples, the networked computer resources 830 may be distributed across multiple computer resources through a cloud infrastructure. The example of a single computer server 830 is not intended to be limiting, but is merely an example of computing resources that may be utilized by the systems and methods described herein. Example Computer Device
[0103] As described, any number of computing devices may be arranged into or connected to the various component parts of the systems described herein. Such systems may be local and connected to the systems described herein. Figure 8 In some examples, some computing resources may be networked, or communicate over a network, so that they do not have to be co-located with the optical system described herein. In any case, any computing system used herein may include, for example, Fig. 9 Component parts such as those described in .
[0104] Fig. 9 An example computing device 900 that can be used in the systems and methods described herein is shown. In the example computer 900, a CPU or processor 910 communicates with a user interface 914 via a bus or other communication 912. The user interface includes example input devices such as a keyboard, a mouse, a touch screen, buttons, a joystick, or (one or more) other user input devices. The user interface 914 also includes a display device 918, such as a screen. Fig. 9 The computing device 900 shown in also includes a network interface 920 that communicates with the CPU 920 and other components. The network interface 920 can allow the computing device 900 to communicate with other computers, databases, networks, user devices, or any other computing-capable devices. In some examples, the communication method can be through WiFi, cellular, Bluetooth low energy, wired communication, or any other kind of communication. In some examples, the example computing device 900 includes a peripheral device 924 that also communicates with the processor 910. In some examples, the peripheral device includes an antenna 926 for communication. In some examples, the peripheral device 924 may include a camera device. In some example computing devices 900, a memory 922 communicates with the processor 910. In some examples, the memory 922 may include instructions for executing software (such as an operating system 932), a network communication module 934, other instructions 936, applications 938, data storage devices 958, data (such as data tables 960, transaction logs 962, sample data 964, encrypted data 970, or any other kind of data). in conclusion
[0105] As disclosed herein, features consistent with the present embodiment can be implemented via computer hardware, software and / or firmware. For example, the systems and methods disclosed herein can be embodied in various forms, including, for example, data processors, such as computers that also include databases, digital electronic circuits, firmware, software, computer networks, servers, or combinations thereof. In addition, although some public implementations describe specific hardware components, systems and methods consistent with the innovations herein can be implemented with any combination of hardware, software, and / or firmware. In addition, the above-mentioned features and other aspects and principles of the innovations herein can be implemented in various environments. Such environments and related applications can be specially constructed for performing various routines, processes, and / or operations according to the embodiments, or they can include general-purpose computers or computing platforms selectively activated or reconfigured by code to provide the necessary functionality. The processes disclosed herein are not inherently related to any particular computer, network, architecture, environment, or other device, and can be implemented by appropriate combinations of hardware, software, and / or firmware. For example, various general-purpose machines can be used with programs written according to the teachings of the embodiments, or it may be more convenient to build special-purpose devices or systems to perform the required methods and techniques.
[0106] Various aspects of the methods and systems described herein, such as logic, can be implemented as functionality programmed into any of a variety of circuits, including programmable logic devices ("PLDs"), such as field programmable gate arrays ("FPGAs"), programmable array logic ("PAL") devices, electrically programmable logic and memory devices, and standard cell-based devices, and application-specific integrated circuits. Some other possibilities for implementing various aspects include: memory devices, microcontrollers with memory (e.g., EEPROM), embedded microprocessors, firmware, software, etc. In addition, various aspects can be embodied in microprocessors with software-based circuit simulation, discrete logic (sequential and combinational), custom devices, fuzzy (neural) logic, quantum devices, and a mixture of any of the above device types. The underlying device technology can be provided in a variety of component types, such as metal oxide semiconductor field effect transistor ("MOSFET") technology such as complementary metal oxide semiconductor ("CMOS"), bipolar technology such as emitter coupled logic ("ECL"), polymer technology (e.g., silicon conjugated polymers and metal conjugated polymer-metal structures), mixed analog and digital technology, and the like.
[0107] It should also be noted that various logic and / or functions disclosed herein may be implemented using any number of combinations of hardware, firmware, and / or data and / or instructions embodied in various machine-readable or computer-readable media in terms of their behavior, register transfers, logic components, and / or other characteristics. Computer-readable media that may embody such formatted data and / or instructions include, but are not limited to, non-volatile storage media (e.g., optical, magnetic, or semiconductor storage media) in various forms and carriers that may be used to transmit such formatted data and / or instructions via wireless, optical, or wired signaling media, or any combination thereof. Examples of transmitting such formatted data and / or instructions via carriers include, but are not limited to, transmission (upload, download, email, etc.) over the Internet and / or other computer networks via one or more data transmission protocols (e.g., HTTP, FTP, SMTP, etc.).
[0108] Unless the context clearly requires otherwise, throughout the specification and claims, the words "comprise," "comprising," and the like are to be interpreted in an inclusive sense, as opposed to an exclusive or exhaustive sense; that is, in the sense of "including, but not limited to." Words using the singular or plural number also include the plural or singular number, respectively. In addition, the words "herein," "herein below," "above," "below," and words of similar meaning refer to this application as a whole and not to any particular parts of this application. When the word "or" is used to refer to a list of two or more items, the word encompasses all of the following interpretations of the word: any item in the list, all items in the list, and any combination of the items in the list.
[0109] Although some currently preferred implementations of the present specification have been specifically described herein, it will be apparent to those skilled in the art that the various implementations shown and described herein may be changed and modified without departing from the spirit and scope of the embodiments. Therefore, it is intended that the embodiments be limited only to the extent required by the applicable regulations of law.
[0110] The present embodiment can be embodied in the form of methods and the equipment for practicing those methods. The present embodiment can also be implemented in the form of program code, which is embodied in a tangible medium, such as a floppy disk, a CD-ROM, a hard disk drive or any other machine-readable storage medium, wherein, when the program code is loaded into a machine (such as a computer) and executed by the machine, the machine becomes the equipment for practicing the embodiment. The present embodiment can also take the form of program code, such as whether it is stored in a storage medium, loaded into a machine and / or executed by a machine, or transmitted by some transmission media (such as by wires or cables, by optical fibers or via electromagnetic radiation), wherein when the program code is loaded into a machine (such as a computer) and executed by the machine, the machine becomes the equipment for practicing the embodiment. When implemented on a general-purpose processor, the program code segment is combined with the processor to provide a unique device that operates similar to a specific logic circuit.
[0111] The software is stored in a machine-readable medium, which can take many forms, including but not limited to tangible storage media, carrier media, or physical transmission media. Non-volatile storage media include, for example, optical or magnetic disks, such as any storage device in any (one or more) computers, etc. Volatile storage media include dynamic memory, such as the main memory of such a computer platform. Tangible transmission media include coaxial cables; copper wires and optical fibers, including wires, which include buses within a computer system. Carrier transmission media can take the form of electrical or electromagnetic signals, or sound or light waves, such as those generated during radio frequency (RF) and infrared (IR) data communications. Therefore, common forms of computer-readable media include, for example: a disk (e.g., hard disk, floppy disk, floppy disk) or any other magnetic medium, CD-ROM, DVD or DVD-ROM, any other optical medium, any other physical storage medium, RAM, PROM and EPROM, FLASH-EPROM, any other memory chip, a carrier wave that transmits data or instructions, a cable or link that transmits such a carrier wave, or any other medium from which a computer can read programming code and / or data. Many of these forms of computer readable media may be involved in carrying one or more sequences of one or more instructions to a processor for execution.
[0112] For purposes of explanation, the foregoing description has been described with reference to specific embodiments. However, the above illustrative discussion is not intended to be exhaustive or to limit the embodiments to the precise forms disclosed. In light of the above teachings, many modifications and variations are possible. The described embodiments were chosen and described in order to best explain the principles of the embodiments and their practical applications, thereby enabling others skilled in the art to best utilize various embodiments with various modifications suitable for the particular use contemplated.
Claims
1. A computer-implemented method comprising: collecting data associated with each event being executed by the computing system at a particular instance in time, wherein each event is part of a thread of associated events; generating, for each thread, a circular buffer specifying each event being executed at the particular time instance; storing data associated with each event of the thread in the circular buffer; retrieving stored data from one or more ring buffers; generating an output representing said stored data from said ring buffer; and Causes display of said output.
2. The computer-implemented method of claim 1 , wherein: The ring buffer is stored per thread event in a size corresponding to the CPU L2 cache or L1 cache.
3. The computer-implemented method of claim 2, wherein: The size of the event data is 64 bytes.
4. The computer-implemented method of claim 1 , wherein: The data collected for each event includes any of: a timestamp, an event type, and one or more type-specific parameters.
5. The computer-implemented method of claim 1 , wherein: The scope of each event is derived based on the timing of each event being executed by the aggregate.
6. The computer-implemented method of claim 1 , wherein: Graphical representations include heat maps.
7. A system comprising: one or more processors; One or more non-transitory processor-readable storage devices including instructions that, when executed by the one or more processors, cause the one or more processors to perform operations comprising: collecting data associated with each event being executed at a particular instance of time, wherein each event is part of a thread associated with the event; generating, for each thread, a buffer specifying each event being executed at the particular time instance; generating an output representing the data from the buffer; and Causes display of said output.
8. The system according to claim 7, wherein: The operations further include: storing data associated with each event of the thread in the buffer; and Stored data is retrieved from the buffer, wherein the output is generated based on the stored data of the buffer.
9. The system according to claim 7, wherein: The buffer comprises a ring buffer.
10. The system according to claim 9, wherein: The ring buffer is stored per thread event in a size corresponding to the CPU L2 cache or L1 cache.
11. The system according to claim 10, wherein: The size of the event data is 64 bytes.
12. The system according to claim 7, wherein: The data collected for each event includes any of: a timestamp, an event type, and one or more type-specific parameters.
13. The system according to claim 7, wherein: The scope of each event is derived based on the timing of each event being executed by the aggregate.
14. The system according to claim 7, wherein: Graphical representations include heat maps.
15. One or more non-transitory computer-readable media comprising instructions that, when executed by one or more processors, cause the one or more processors to perform operations comprising: collecting data associated with each event being executed by the computing system at a particular instance in time, wherein each event is part of a thread of associated events; generating, for each thread, a circular buffer specifying each event being executed at the particular time instance; storing data associated with each event of the thread in the circular buffer; retrieving stored data from one or more ring buffers; generating an output representing said stored data from said ring buffer; and Causes display of said output.
16. The one or more non-transitory computer-readable media of claim 15, wherein: The ring buffer is stored per thread event in a size corresponding to the CPU L2 cache or L1 cache.
17. The one or more non-transitory computer-readable media of claim 16, wherein: The size of the event data is 64 bytes.
18. The one or more non-transitory computer-readable media of claim 15, wherein: The data collected for each event includes any of: a timestamp, an event type, and one or more type-specific parameters.
19. The one or more non-transitory computer-readable media of claim 15, wherein: The scope of each event is derived based on the timing of each event being executed by the aggregate.
20. The one or more non-transitory computer-readable media of claim 15, wherein: Graphical representations include heat maps.
