Add dtrace probes for rendering and damage checking

pull/55/head
Andri Yngvason 2020-07-07 13:44:41 +00:00
parent e5272618ba
commit 73ade6b84e
1 changed files with 9 additions and 0 deletions

View File

@ -53,6 +53,7 @@
#include "pixman-renderer.h" #include "pixman-renderer.h"
#include "transform-util.h" #include "transform-util.h"
#include "damage-refinery.h" #include "damage-refinery.h"
#include "usdt.h"
#define DEFAULT_ADDRESS "127.0.0.1" #define DEFAULT_ADDRESS "127.0.0.1"
#define DEFAULT_PORT 5900 #define DEFAULT_PORT 5900
@ -471,10 +472,14 @@ static void on_render(struct nvnc_display* display, struct nvnc_fb* fb)
if (!self->screencopy.back) if (!self->screencopy.back)
return; return;
DTRACE_PROBE(wayvnc, render_start);
enum wl_output_transform transform = self->selected_output->transform; enum wl_output_transform transform = self->selected_output->transform;
wv_pixman_render(fb, self->screencopy.back, transform, wv_pixman_render(fb, self->screencopy.back, transform,
&self->current_damage); &self->current_damage);
pixman_region_clear(&self->current_damage); pixman_region_clear(&self->current_damage);
DTRACE_PROBE(wayvnc, render_end);
} }
static void wayvnc_damage_region(struct wayvnc* self, static void wayvnc_damage_region(struct wayvnc* self,
@ -506,6 +511,8 @@ void wayvnc_process_frame(struct wayvnc* self)
} }
} }
DTRACE_PROBE(wayvnc, refine_damage_start);
struct pixman_region16 txdamage, refined; struct pixman_region16 txdamage, refined;
pixman_region_init(&txdamage); pixman_region_init(&txdamage);
pixman_region_init(&refined); pixman_region_init(&refined);
@ -521,6 +528,8 @@ void wayvnc_process_frame(struct wayvnc* self)
pixman_region_fini(&refined); pixman_region_fini(&refined);
pixman_region_fini(&txdamage); pixman_region_fini(&txdamage);
DTRACE_PROBE(wayvnc, refine_damage_end);
if (wayvnc_start_capture(self) < 0) { if (wayvnc_start_capture(self) < 0) {
log_error("Failed to start capture. Exiting...\n"); log_error("Failed to start capture. Exiting...\n");
wayvnc_exit(self); wayvnc_exit(self);