mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-23 22:40:34 +01:00
util/u_trace: Add u_trace_move()
Destructively copy trace contents to another trace, transfering ownership of resources. This will be useful for turnip. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35751>
This commit is contained in:
parent
10ae673368
commit
7791b5286c
2 changed files with 11 additions and 0 deletions
|
|
@ -793,6 +793,16 @@ u_trace_init(struct u_trace *ut, struct u_trace_context *utctx)
|
|||
list_inithead(&ut->trace_chunks);
|
||||
}
|
||||
|
||||
void
|
||||
u_trace_move(struct u_trace *dst, struct u_trace *src)
|
||||
{
|
||||
dst->utctx = src->utctx;
|
||||
list_replace(&src->trace_chunks, &dst->trace_chunks);
|
||||
dst->num_traces = src->num_traces;
|
||||
src->num_traces = 0;
|
||||
list_delinit(&src->trace_chunks);
|
||||
}
|
||||
|
||||
void
|
||||
u_trace_fini(struct u_trace *ut)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -300,6 +300,7 @@ void u_trace_context_fini(struct u_trace_context *utctx);
|
|||
void u_trace_context_process(struct u_trace_context *utctx, bool eof);
|
||||
|
||||
void u_trace_init(struct u_trace *ut, struct u_trace_context *utctx);
|
||||
void u_trace_move(struct u_trace *dst, struct u_trace *src);
|
||||
void u_trace_fini(struct u_trace *ut);
|
||||
|
||||
void u_trace_state_init(void);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue