![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "develop/supervisor.h"#include "common/image.h"#include "common/introspection.h"#include "develop/imageop.h"#include "develop/blend.h"#include "develop/masks.h"#include "develop/pixelpipe_cache.h"#include "develop/pixelpipe_hb.h"#include <json-glib/json-glib.h>#include <stdarg.h>#include <stdio.h>
Include dependency graph for supervisor.c:Go to the source code of this file.
Data Structures | |
| struct | dt_sv_entry_t |
Macros | |
| #define | DT_SV_LOG_MAX 20000 |
Typedefs | |
| typedef enum dt_sv_facet_t | dt_sv_facet_t |
| typedef struct dt_sv_entry_t | dt_sv_entry_t |
Enumerations | |
| enum | dt_sv_facet_t { DT_SV_F_HISTORY = 1 << 0 , DT_SV_F_NODE = 1 << 1 , DT_SV_F_CACHE = 1 << 2 , DT_SV_F_BACKBUF = 1 << 3 , DT_SV_F_WIDGET = 1 << 4 , DT_SV_F_THUMB = 1 << 5 , DT_SV_F_MIPMAP = 1 << 6 , DT_SV_F_IMAGE = 1 << 7 , DT_SV_F_FORM = 1 << 8 , DT_SV_F_CACHEWAIT = 1 << 9 } |
Functions | |
| static void | _logged_event_free (gpointer p) |
| static gboolean | _hash_is_set (const uint64_t h) |
| static const char * | _op_str (const dt_sv_op_t op) |
| static uint64_t | _fnv1a (const char *s, const int a, const int b) |
| uint64_t | dt_supervisor_node_key (const int pipe_type, const char *op_name, const int multi_priority) |
| static uint64_t | _thumb_key (const int32_t imgid, const int mip) |
| uint64_t | dt_supervisor_thumbnail_key (const int32_t imgid, const int mip) |
| static uint64_t | _mipmap_key (const int32_t imgid, const int mip) |
| uint64_t | dt_supervisor_mipmap_key (const int32_t imgid, const int mip) |
| static uint64_t | _image_key (const int32_t imgid) |
| uint64_t | dt_supervisor_image_key (const int32_t imgid) |
| static uint64_t | _form_key (const int formid) |
| static uint64_t | _cache_wait_key (const uint64_t request_id) |
| uint64_t | dt_supervisor_form_key (const int formid) |
| static const char * | _form_type_name (const int type) |
| static JsonArray * | _form_members_json (const dt_masks_form_t *form) |
| static JsonArray * | _forms_json (GList *forms) |
| static void | _device_string (const int devid, char *out, const size_t out_size) |
| static const char * | _thread_tag (void) |
| void | dt_supervisor_init (void) |
| void | dt_supervisor_cleanup (void) |
| void | dt_supervisor_set_recording (const gboolean on) |
| void | dt_supervisor_events_clear (void) |
| static dt_sv_entry_t * | _entry_get_locked (const uint64_t hash, gboolean *created) |
| static gboolean | _touch_alive_locked (dt_sv_entry_t *e, const gboolean created, const dt_sv_op_t op) |
| static const char * | _primary_domain (const dt_sv_entry_t *e) |
| static int | _entry_pipe_type (const dt_sv_entry_t *e) |
| static void | _module_label (const dt_sv_entry_t *e, char *out, const size_t out_size) |
| static void | _set_hash_member (JsonObject *o, const char *name, const uint64_t hash) |
| static JsonObject * | _resolve_locked (const uint64_t hash) |
| static uint64_t | _parse_hash (const char *s) |
| static dt_sv_logged_event_t * | _extract_event (JsonObject *root, const gchar *json_str) |
| static void | _log_push (dt_sv_logged_event_t *e) |
| static void | _emit_line (JsonObject *root) |
| static void | _introspect_dump (dt_introspection_field_t *field, const char *prefix, gpointer params, JsonArray *out) |
| static JsonArray * | _params_json (const dt_iop_module_t *module, const void *params) |
| static void | _arr_addf (JsonArray *out, const char *fmt,...) G_GNUC_PRINTF(2 |
| static const char * | _name_for_value (const dt_develop_name_value_t *list, const int value) |
| static void | _arr_add_enum (JsonArray *out, const char *label, const dt_develop_name_value_t *names, const int value) |
| static JsonArray * | _blendop_json (const dt_develop_blend_params_t *bp) |
| static JsonObject * | _envelope (const dt_sv_op_t op, const char *domain, const uint64_t hash, const int pipe_type, const int32_t imgid, const gboolean alive, const gboolean resurrected) |
| void | dt_supervisor_history (const dt_sv_op_t op, const uint64_t param_hash, const char *op_name, const int multi_priority, const char *multi_name, const int iop_order, const int history_index, const int32_t imgid, const gboolean enabled, const dt_iop_module_t *module, const void *params, const dt_develop_blend_params_t *blend_params, GList *forms) |
| void | dt_supervisor_node (const dt_sv_op_t op, const uint64_t node_hash, const uint64_t param_hash, const uint64_t predecessor_hash, const char *op_name, const int multi_priority, const int iop_order, const int pipe_type, const int32_t imgid) |
| void | dt_supervisor_cacheline_create (const uint64_t hash, const uint64_t node_hash, const uint64_t param_hash, const uint64_t input_hash, const char *op_name, const int multi_priority, const int iop_order, const int pipe_type, const int32_t imgid, const int roi_w, const int roi_h, const int devid, const size_t size, const char *name) |
| void | dt_supervisor_cacheline_read (const uint64_t hash, const size_t size) |
| void | dt_supervisor_cacheline_delete (const uint64_t hash, const size_t size, const int owner_pipe_id, const char *name) |
| void | dt_supervisor_cache_wait (const dt_sv_op_t op, const uint64_t request_id, const uint64_t awaited_hash, const char *owner_tag, const char *op_name, const int multi_priority, const int pipe_type, const int32_t imgid, const gboolean request_emitted, const char *note) |
| static JsonObject * | _rekey_record (const dt_sv_op_t op, const dt_sv_entry_t *e, const uint64_t hash, const char *link_field, const uint64_t link_hash, const gboolean alive) |
| void | dt_supervisor_rekey (const uint64_t old_hash, const uint64_t new_hash) |
| void | dt_supervisor_backbuf (const dt_sv_op_t op, const uint64_t hash, const uint64_t history_hash, const int w, const int h, const int bpp, const int pipe_type, const int devid) |
| void | dt_supervisor_widget (const dt_sv_op_t op, const char *widget_tag, const uint64_t consumed_hash, const int pipe_type, const int32_t imgid) |
| void | dt_supervisor_thumbnail (const dt_sv_op_t op, const int32_t imgid, const int width, const int height, const int mip, const gboolean success) |
| static JsonObject * | _image_properties_json (const dt_image_t *img) |
| void | dt_supervisor_mipmap (const dt_sv_op_t op, const int32_t imgid, const int mip) |
| void | dt_supervisor_image (const dt_sv_op_t op, const int32_t imgid, const dt_image_t *img) |
| void | dt_supervisor_form (const dt_sv_op_t op, const dt_masks_form_t *form) |
| static void | _describe_edge (GString *s, const char *prefix, const uint64_t hash) |
| gchar * | dt_supervisor_describe (const uint64_t hash) |
| static dt_sv_logged_event_t * | _event_copy (const dt_sv_logged_event_t *src) |
| GPtrArray * | dt_supervisor_events_snapshot (void) |
| GPtrArray * | dt_supervisor_events_snapshot_since (const uint64_t after_seq, uint64_t *out_last_seq) |
| guint | dt_supervisor_events_count (void) |
| void | dt_supervisor_events_free (GPtrArray *events) |
Variables | ||
| gint | dt_supervisor_recording = 0 | |
| struct { | ||
| GHashTable * entries | ||
| GQueue * log | ||
| uint64_t next_seq | ||
| dt_pthread_mutex_t lock | ||
| gboolean inited | ||
| } | _sv = { 0 } | |
| #define DT_SV_LOG_MAX 20000 |
Definition at line 110 of file supervisor.c.
| typedef struct dt_sv_entry_t dt_sv_entry_t |
| typedef enum dt_sv_facet_t dt_sv_facet_t |
| enum dt_sv_facet_t |
| Enumerator | |
|---|---|
| DT_SV_F_HISTORY | |
| DT_SV_F_NODE | |
| DT_SV_F_CACHE | |
| DT_SV_F_BACKBUF | |
| DT_SV_F_WIDGET | |
| DT_SV_F_THUMB | |
| DT_SV_F_MIPMAP | |
| DT_SV_F_IMAGE | |
| DT_SV_F_FORM | |
| DT_SV_F_CACHEWAIT | |
Definition at line 35 of file supervisor.c.
|
static |
Definition at line 745 of file supervisor.c.
References _arr_addf(), _name_for_value(), n, out, and value.
Referenced by _blendop_json().
Definition at line 728 of file supervisor.c.
References out.
Referenced by _arr_add_enum(), and _blendop_json().
|
static |
Definition at line 755 of file supervisor.c.
References _arr_add_enum(), _arr_addf(), dt_develop_blend_params_t::blend_cst, dt_develop_blend_params_t::blend_mode, dt_develop_blend_params_t::blend_parameter, dt_develop_blend_params_t::blur_radius, dt_develop_blend_params_t::brightness, dt_develop_blend_params_t::contrast, dt_develop_blend_params_t::details, DEVELOP_BLEND_MODE_MASK, DEVELOP_BLEND_REVERSE, DEVELOP_COMBINE_INCL, DEVELOP_COMBINE_INV, DEVELOP_MASK_DISABLED, dt_develop_blend_colorspace_names, dt_develop_blend_mode_flag_names, dt_develop_blend_mode_names, dt_develop_combine_masks_names, dt_develop_feathering_guide_names, dt_develop_invert_mask_names, dt_develop_mask_mode_names, dt_develop_blend_params_t::feathering_guide, dt_develop_blend_params_t::feathering_radius, dt_develop_blend_params_t::mask_combine, dt_develop_blend_params_t::mask_id, dt_develop_blend_params_t::mask_mode, dt_develop_blend_params_t::opacity, out, dt_develop_blend_params_t::raster_mask_id, dt_develop_blend_params_t::raster_mask_instance, and dt_develop_blend_params_t::raster_mask_invert.
Referenced by dt_supervisor_history().
Definition at line 204 of file supervisor.c.
References _fnv1a().
Referenced by dt_supervisor_cache_wait().
Definition at line 1367 of file supervisor.c.
References _hash_is_set(), _module_label(), _sv, and dt_sv_entry_t::alive.
Referenced by dt_supervisor_describe().
|
static |
Definition at line 270 of file supervisor.c.
References out.
Referenced by dt_supervisor_backbuf(), dt_supervisor_cacheline_create(), and dt_supervisor_describe().
|
static |
Definition at line 566 of file supervisor.c.
References _extract_event(), _log_push(), darktable, DT_DEBUG_SUPERVISOR, dt_supervisor_recording, FALSE, and darktable_t::unmuted.
Referenced by dt_supervisor_backbuf(), dt_supervisor_cache_wait(), dt_supervisor_cacheline_create(), dt_supervisor_cacheline_delete(), dt_supervisor_cacheline_read(), dt_supervisor_form(), dt_supervisor_history(), dt_supervisor_image(), dt_supervisor_mipmap(), dt_supervisor_node(), dt_supervisor_rekey(), dt_supervisor_thumbnail(), and dt_supervisor_widget().
|
static |
Definition at line 321 of file supervisor.c.
References _sv, dt_sv_entry_t::alive, dt_sv_entry_t::devid, DT_PIXELPIPE_CACHE_HASH_INVALID, FALSE, dt_sv_entry_t::hash, dt_sv_entry_t::history_hash, dt_sv_entry_t::image_hash, dt_sv_entry_t::input_hash, key, dt_sv_entry_t::node_hash, dt_sv_entry_t::param_hash, dt_sv_entry_t::pred_hash, and TRUE.
Referenced by dt_supervisor_backbuf(), dt_supervisor_cache_wait(), dt_supervisor_cacheline_create(), dt_supervisor_cacheline_delete(), dt_supervisor_cacheline_read(), dt_supervisor_form(), dt_supervisor_history(), dt_supervisor_image(), dt_supervisor_mipmap(), dt_supervisor_node(), dt_supervisor_rekey(), and dt_supervisor_thumbnail().
|
static |
Definition at line 376 of file supervisor.c.
References DT_SV_F_BACKBUF, DT_SV_F_CACHE, DT_SV_F_NODE, dt_sv_entry_t::facets, and dt_sv_entry_t::pipe_type.
Referenced by _rekey_record().
|
static |
Definition at line 786 of file supervisor.c.
References _op_str(), _set_hash_member(), _thread_tag(), darktable, dt_get_wtime(), dt_pixelpipe_get_pipe_name(), darktable_t::start_wtime, and TRUE.
Referenced by _rekey_record(), dt_supervisor_backbuf(), dt_supervisor_cache_wait(), dt_supervisor_cacheline_create(), dt_supervisor_cacheline_delete(), dt_supervisor_cacheline_read(), dt_supervisor_form(), dt_supervisor_history(), dt_supervisor_image(), dt_supervisor_mipmap(), dt_supervisor_node(), dt_supervisor_thumbnail(), and dt_supervisor_widget().
|
static |
Definition at line 1457 of file supervisor.c.
References FALSE, dt_sv_logged_event_t::json, and dt_sv_logged_event_t::links.
Referenced by dt_supervisor_events_snapshot(), and dt_supervisor_events_snapshot_since().
|
static |
Definition at line 430 of file supervisor.c.
References _parse_hash(), dt_sv_logged_event_t::cache_name, d, dt_sv_logged_event_t::domain, FALSE, dt_sv_link_t::hash, dt_sv_logged_event_t::hash, i, dt_sv_logged_event_t::json, k, dt_sv_link_t::label, dt_sv_logged_event_t::links, m, dt_sv_logged_event_t::mnemonic, n, dt_sv_logged_event_t::op, dt_sv_logged_event_t::thread, and dt_sv_logged_event_t::ts.
Referenced by _emit_line().
|
static |
Definition at line 150 of file supervisor.c.
References DT_PIXELPIPE_CACHE_HASH_INVALID, and p.
Referenced by _cache_wait_key(), _form_key(), _image_key(), _mipmap_key(), _thumb_key(), and dt_supervisor_node_key().
|
static |
Definition at line 196 of file supervisor.c.
References _fnv1a().
Referenced by _form_members_json(), _forms_json(), dt_supervisor_form(), and dt_supervisor_form_key().
|
static |
Definition at line 228 of file supervisor.c.
References _form_key(), DT_MASKS_GROUP, g, p, dt_masks_form_t::points, and dt_masks_form_t::type.
Referenced by _forms_json(), and dt_supervisor_form().
|
static |
Definition at line 214 of file supervisor.c.
References DT_MASKS_BRUSH, DT_MASKS_CIRCLE, DT_MASKS_ELLIPSE, DT_MASKS_GRADIENT, DT_MASKS_GROUP, DT_MASKS_POLYGON, and type.
Referenced by _forms_json(), dt_supervisor_describe(), and dt_supervisor_form().
|
static |
Definition at line 247 of file supervisor.c.
References _form_key(), _form_members_json(), _form_type_name(), f, dt_masks_form_t::formid, dt_masks_form_t::name, out, and dt_masks_form_t::type.
Referenced by dt_supervisor_history().
|
inlinestatic |
Definition at line 132 of file supervisor.c.
References DT_PIXELPIPE_CACHE_HASH_INVALID.
Referenced by _describe_edge(), _resolve_locked(), dt_supervisor_cache_wait(), dt_supervisor_cacheline_create(), dt_supervisor_node(), and dt_supervisor_rekey().
|
static |
Definition at line 186 of file supervisor.c.
References _fnv1a().
Referenced by dt_supervisor_history(), dt_supervisor_image(), dt_supervisor_image_key(), and dt_supervisor_mipmap().
|
static |
Definition at line 1239 of file supervisor.c.
References dt_image_t::camera_makermodel, dt_image_t::datetime, dt_image_t::exif_aperture, dt_image_t::exif_exposure, dt_image_t::exif_focal_length, dt_image_t::exif_iso, dt_image_t::exif_lens, dt_image_t::filename, dt_image_t::film_id, dt_image_t::flags, flags, dt_image_t::folder, dt_image_t::group_id, dt_image_t::height, dt_image_t::id, dt_image_t::loader, dt_image_t::orientation, dt_image_t::p_height, dt_image_t::p_width, dt_image_t::version, and dt_image_t::width.
Referenced by dt_supervisor_image().
|
static |
Definition at line 593 of file supervisor.c.
References _introspect_dump(), dt_introspection_field_t::Array, dt_introspection_type_array_t::count, dt_introspection_type_header_t::description, DT_INTROSPECTION_TYPE_ARRAY, DT_INTROSPECTION_TYPE_BOOL, DT_INTROSPECTION_TYPE_CHAR, DT_INTROSPECTION_TYPE_DOUBLE, DT_INTROSPECTION_TYPE_ENUM, DT_INTROSPECTION_TYPE_FLOAT, DT_INTROSPECTION_TYPE_INT, DT_INTROSPECTION_TYPE_INT8, DT_INTROSPECTION_TYPE_SHORT, DT_INTROSPECTION_TYPE_STRUCT, DT_INTROSPECTION_TYPE_UINT, DT_INTROSPECTION_TYPE_UINT8, DT_INTROSPECTION_TYPE_UNION, DT_INTROSPECTION_TYPE_USHORT, dt_introspection_type_struct_t::entries, dt_introspection_field_t::Enum, dt_introspection_type_array_t::field, dt_introspection_type_header_t::field_name, dt_introspection_type_struct_t::fields, dt_introspection_field_t::header, i, name, dt_introspection_type_header_t::offset, out, p, dt_introspection_type_header_t::size, dt_introspection_field_t::Struct, t, dt_introspection_type_header_t::type, dt_introspection_type_array_t::type, and dt_introspection_type_enum_t::values.
Referenced by _introspect_dump(), and _params_json().
|
static |
Definition at line 549 of file supervisor.c.
References _logged_event_free(), _sv, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), DT_SV_LOG_MAX, and dt_sv_logged_event_t::seq.
Referenced by _emit_line().
|
static |
Definition at line 123 of file supervisor.c.
References dt_sv_logged_event_t::json, dt_sv_logged_event_t::links, p, and TRUE.
Referenced by _log_push(), dt_supervisor_cleanup(), dt_supervisor_events_clear(), dt_supervisor_events_snapshot(), and dt_supervisor_events_snapshot_since().
|
static |
Definition at line 176 of file supervisor.c.
References _fnv1a().
Referenced by dt_supervisor_mipmap(), dt_supervisor_mipmap_key(), and dt_supervisor_thumbnail().
|
static |
Definition at line 384 of file supervisor.c.
References dt_sv_entry_t::multi_priority, dt_sv_entry_t::op_name, and out.
Referenced by _describe_edge(), _rekey_record(), _resolve_locked(), dt_supervisor_backbuf(), dt_supervisor_cache_wait(), dt_supervisor_cacheline_create(), dt_supervisor_cacheline_delete(), dt_supervisor_cacheline_read(), dt_supervisor_describe(), dt_supervisor_history(), and dt_supervisor_node().
|
static |
Definition at line 738 of file supervisor.c.
References i, dt_iop_blend_name_value_t::name, and value.
Referenced by _arr_add_enum().
|
static |
Definition at line 137 of file supervisor.c.
References DT_SV_CREATE, DT_SV_DELETE, DT_SV_READ, and DT_SV_UPDATE.
Referenced by _envelope().
|
static |
Definition at line 711 of file supervisor.c.
References _introspect_dump(), dt_introspection_t::field, dt_iop_module_t::have_introspection, and out.
Referenced by dt_supervisor_history().
|
static |
Definition at line 423 of file supervisor.c.
Referenced by _extract_event().
|
static |
Definition at line 360 of file supervisor.c.
References DT_SV_F_BACKBUF, DT_SV_F_CACHE, DT_SV_F_CACHEWAIT, DT_SV_F_FORM, DT_SV_F_HISTORY, DT_SV_F_IMAGE, DT_SV_F_MIPMAP, DT_SV_F_NODE, DT_SV_F_THUMB, and dt_sv_entry_t::facets.
Referenced by _rekey_record().
|
static |
Definition at line 1062 of file supervisor.c.
References _entry_pipe_type(), _envelope(), _module_label(), _primary_domain(), _resolve_locked(), _set_hash_member(), FALSE, dt_sv_entry_t::imgid, dt_sv_entry_t::node_hash, and dt_sv_entry_t::param_hash.
Referenced by dt_supervisor_rekey().
|
static |
Definition at line 400 of file supervisor.c.
References _hash_is_set(), _module_label(), _set_hash_member(), _sv, dt_sv_entry_t::alive, DT_SV_F_CACHE, DT_SV_F_HISTORY, DT_SV_F_NODE, dt_sv_entry_t::enabled, dt_sv_entry_t::facets, dt_sv_entry_t::history_index, and dt_sv_entry_t::iop_order.
Referenced by _rekey_record(), dt_supervisor_backbuf(), dt_supervisor_cache_wait(), dt_supervisor_cacheline_create(), dt_supervisor_cacheline_delete(), dt_supervisor_cacheline_read(), dt_supervisor_mipmap(), dt_supervisor_node(), and dt_supervisor_widget().
Definition at line 390 of file supervisor.c.
References name.
Referenced by _envelope(), _rekey_record(), _resolve_locked(), dt_supervisor_backbuf(), dt_supervisor_cache_wait(), dt_supervisor_mipmap(), and dt_supervisor_thumbnail().
|
static |
Definition at line 276 of file supervisor.c.
Referenced by _envelope().
|
static |
Definition at line 166 of file supervisor.c.
References _fnv1a().
Referenced by dt_supervisor_thumbnail(), and dt_supervisor_thumbnail_key().
|
static |
Definition at line 346 of file supervisor.c.
References dt_sv_entry_t::alive, DT_SV_DELETE, FALSE, and TRUE.
Referenced by dt_supervisor_backbuf(), dt_supervisor_cache_wait(), dt_supervisor_cacheline_create(), dt_supervisor_cacheline_delete(), dt_supervisor_cacheline_read(), dt_supervisor_form(), dt_supervisor_history(), dt_supervisor_image(), dt_supervisor_mipmap(), dt_supervisor_node(), and dt_supervisor_thumbnail().
| void dt_supervisor_backbuf | ( | dt_sv_op_t | op, |
| uint64_t | hash, | ||
| uint64_t | history_hash, | ||
| int | w, | ||
| int | h, | ||
| int | bpp, | ||
| int | pipe_type, | ||
| int | devid | ||
| ) |
Backbuffer event — keyed by the cacheline hash it promotes as the pipe output. Merges into the cacheline entry sharing that hash, so the producing module is resolved automatically.
Definition at line 1132 of file supervisor.c.
References _device_string(), _emit_line(), _entry_get_locked(), _envelope(), _module_label(), _resolve_locked(), _set_hash_member(), _sv, _touch_alive_locked(), dt_sv_entry_t::alive, dt_sv_entry_t::bb_bpp, dt_sv_entry_t::bb_h, dt_sv_entry_t::bb_w, bpp, dt_sv_entry_t::devid, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_supervisor_active(), DT_SV_F_BACKBUF, dt_sv_entry_t::facets, dt_sv_entry_t::history_hash, dt_sv_entry_t::imgid, dt_sv_entry_t::param_hash, dt_sv_entry_t::pipe_type, and size.
Referenced by _update_backbuf_cache_reference().
| void dt_supervisor_cache_wait | ( | dt_sv_op_t | op, |
| uint64_t | request_id, | ||
| uint64_t | awaited_hash, | ||
| const char * | owner_tag, | ||
| const char * | op_name, | ||
| int | multi_priority, | ||
| int | pipe_type, | ||
| int32_t | imgid, | ||
| gboolean | request_emitted, | ||
| const char * | note | ||
| ) |
Cache-wait request event — one queued GUI fetch through the cache-wait manager (dev_pixelpipe.c). Keyed by a synthetic key over request_id, so the queue / serve / cancel of one request fold onto a single object and successive requests from the same consumer stay distinct.
The event carries an awaits edge to the cacheline hash the GUI is blocked on: clicking it walks cache-wait -> awaits -> cacheline. If no cacheline was ever published under that hash, the edge degrades to a raw awaits_hash — that missing target is the fingerprint of the "order to grab a cacheline is never
processed" failure (the pipe published a different hash than the GUI awaits, so CACHELINE_READY never matches the pending record).
| op | CREATE at queue, READ on a deduped re-poll (a repeat peek that found the same wait in flight and suppressed a new CACHE_REQUEST), DELETE at serve or cancel. |
| request_id | the wait's monotonic request id (identity). |
| awaited_hash | the cacheline hash being waited on. |
| owner_tag | consumer label (e.g. "color-picker-input"). |
| op_name | target module op (NULL for a backbuf request). |
| request_emitted | TRUE when this event also (re)emitted a CACHE_REQUEST to the pipe; FALSE on a deduped re-poll. |
| note | optional free-text qualifier ("served", "cancelled: …"). |
Definition at line 1013 of file supervisor.c.
References _cache_wait_key(), _emit_line(), _entry_get_locked(), _envelope(), _hash_is_set(), _module_label(), _resolve_locked(), _set_hash_member(), _sv, _touch_alive_locked(), dt_sv_entry_t::alive, dt_sv_entry_t::awaits_hash, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_supervisor_active(), DT_SV_F_CACHEWAIT, dt_sv_entry_t::facets, dt_sv_entry_t::imgid, key, dt_sv_entry_t::multi_priority, dt_sv_entry_t::op_name, dt_sv_entry_t::owner_tag, dt_sv_entry_t::pipe_type, dt_sv_entry_t::request_emitted, and dt_sv_entry_t::request_id.
Referenced by _dt_dev_pixelpipe_cache_wait_ready_callback(), dt_dev_pixelpipe_cache_peek_gui(), and dt_dev_pixelpipe_cache_wait_cleanup().
| void dt_supervisor_cacheline_create | ( | uint64_t | hash, |
| uint64_t | node_hash, | ||
| uint64_t | param_hash, | ||
| uint64_t | input_hash, | ||
| const char * | op_name, | ||
| int | multi_priority, | ||
| int | iop_order, | ||
| int | pipe_type, | ||
| int32_t | imgid, | ||
| int | roi_w, | ||
| int | roi_h, | ||
| int | devid, | ||
| size_t | size, | ||
| const char * | name | ||
| ) |
Cacheline output created at runtime publish — keyed by the produced output hash (piece->global_hash). Carries the full linkage so later READ/DELETE events (which only know the hash) resolve against the registry memory.
| node_hash | producing topology node (dt_supervisor_node_key()). |
| param_hash | piece->hash, links to the history/module identity. |
| input_hash | previous enabled piece's output hash, or INVALID/0. |
| devid | OpenCL device id, or < 0 for CPU. |
Definition at line 891 of file supervisor.c.
References _device_string(), _emit_line(), _entry_get_locked(), _envelope(), _hash_is_set(), _module_label(), _resolve_locked(), _sv, _touch_alive_locked(), dt_sv_entry_t::alive, dt_sv_entry_t::cl_name, dt_sv_entry_t::devid, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_supervisor_active(), DT_SV_CREATE, DT_SV_F_CACHE, dt_sv_entry_t::facets, dt_sv_entry_t::imgid, dt_sv_entry_t::input_hash, dt_sv_entry_t::iop_order, dt_sv_entry_t::multi_priority, name, dt_sv_entry_t::node_hash, dt_sv_entry_t::op_name, dt_sv_entry_t::param_hash, dt_sv_entry_t::pipe_type, dt_sv_entry_t::roi_h, dt_sv_entry_t::roi_w, size, and dt_sv_entry_t::size.
Referenced by dt_dev_pixelpipe_process_rec(), dt_develop_blend_process(), and dt_develop_blend_process_cl().
| void dt_supervisor_cacheline_delete | ( | const uint64_t | hash, |
| const size_t | size, | ||
| const int | owner_pipe_id, | ||
| const char * | name | ||
| ) |
Definition at line 982 of file supervisor.c.
References _emit_line(), _entry_get_locked(), _envelope(), _module_label(), _resolve_locked(), _sv, _touch_alive_locked(), dt_sv_entry_t::alive, dt_sv_entry_t::cl_name, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_supervisor_active(), DT_SV_DELETE, DT_SV_F_CACHE, dt_sv_entry_t::facets, FALSE, dt_sv_entry_t::imgid, name, dt_sv_entry_t::node_hash, dt_sv_entry_t::owner_pipe_id, dt_sv_entry_t::param_hash, dt_sv_entry_t::pipe_type, size, and dt_sv_entry_t::size.
Referenced by _free_cache_entry().
Definition at line 952 of file supervisor.c.
References _emit_line(), _entry_get_locked(), _envelope(), _module_label(), _resolve_locked(), _sv, _touch_alive_locked(), dt_sv_entry_t::alive, dt_sv_entry_t::cl_name, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_supervisor_active(), DT_SV_F_CACHE, DT_SV_READ, dt_sv_entry_t::facets, dt_sv_entry_t::imgid, dt_sv_entry_t::input_hash, dt_sv_entry_t::node_hash, dt_sv_entry_t::param_hash, dt_sv_entry_t::pipe_type, size, and dt_sv_entry_t::size.
Referenced by _cache_lookup_existing(), dt_dev_pixelpipe_cache_get(), and dt_dev_pixelpipe_cache_ref_entry_by_hash().
Definition at line 292 of file supervisor.c.
References _logged_event_free(), _sv, dt_pthread_mutex_destroy(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), and FALSE.
Referenced by dt_cleanup().
| gchar * dt_supervisor_describe | ( | uint64_t | hash | ) |
Programmatic human-readable rendering of any tracked object, by hash. Produces the same narrative the NDJSON encodes, e.g. "cacheline 0x71c4 (exposure/0, preview, 1920x1280, cpu) computed from input 0x55ab (colorin/0); params from history state #7" Returns a newly-allocated string (caller g_free()s), or NULL if the hash is unknown or the supervisor is inactive.
Definition at line 1379 of file supervisor.c.
References _describe_edge(), _device_string(), _form_type_name(), _module_label(), _sv, dt_sv_entry_t::alive, dt_sv_entry_t::bb_bpp, dt_sv_entry_t::bb_h, dt_sv_entry_t::bb_w, dt_sv_entry_t::devid, dt_pixelpipe_get_pipe_name(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_supervisor_active(), DT_SV_F_BACKBUF, DT_SV_F_CACHE, DT_SV_F_FORM, DT_SV_F_HISTORY, DT_SV_F_IMAGE, DT_SV_F_MIPMAP, DT_SV_F_NODE, DT_SV_F_THUMB, dt_sv_entry_t::enabled, dt_sv_entry_t::facets, FALSE, dt_sv_entry_t::form_name, dt_sv_entry_t::form_type, dt_sv_entry_t::formid, dt_sv_entry_t::history_index, dt_sv_entry_t::img_filename, dt_sv_entry_t::imgid, dt_sv_entry_t::input_hash, dt_sv_entry_t::iop_order, dt_sv_entry_t::mip, dt_sv_entry_t::param_hash, dt_sv_entry_t::pipe_type, dt_sv_entry_t::roi_h, dt_sv_entry_t::roi_w, and dt_sv_entry_t::thumb_success.
Definition at line 310 of file supervisor.c.
References _logged_event_free(), _sv, dt_pthread_mutex_lock(), and dt_pthread_mutex_unlock().
Referenced by _on_clear().
| guint dt_supervisor_events_count | ( | void | ) |
Definition at line 1508 of file supervisor.c.
References _sv, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), and n.
Referenced by _update_count().
| void dt_supervisor_events_free | ( | GPtrArray * | events | ) |
Definition at line 1517 of file supervisor.c.
References TRUE.
Referenced by _grouped_catch_up(), _poll(), and _run_search().
| GPtrArray * dt_supervisor_events_snapshot | ( | void | ) |
Definition at line 1468 of file supervisor.c.
References _event_copy(), _logged_event_free(), _sv, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), and out.
Referenced by _run_search().
| GPtrArray * dt_supervisor_events_snapshot_since | ( | const uint64_t | after_seq, |
| uint64_t * | out_last_seq | ||
| ) |
Definition at line 1480 of file supervisor.c.
References _event_copy(), _logged_event_free(), _sv, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), i, out, dt_sv_logged_event_t::seq, and t.
Referenced by _grouped_catch_up(), and _poll().
| void dt_supervisor_form | ( | const dt_sv_op_t | op, |
| const dt_masks_form_t * | form | ||
| ) |
Definition at line 1335 of file supervisor.c.
References _emit_line(), _entry_get_locked(), _envelope(), _form_key(), _form_members_json(), _form_type_name(), _sv, _touch_alive_locked(), dt_sv_entry_t::alive, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_supervisor_active(), DT_SV_CREATE, DT_SV_F_FORM, dt_sv_entry_t::facets, dt_sv_entry_t::form_name, dt_sv_entry_t::form_type, dt_masks_form_t::formid, dt_sv_entry_t::formid, key, dt_masks_form_t::name, dt_masks_form_t::type, and dt_masks_form_t::version.
Referenced by dt_masks_create(), and dt_supervisor_history().
| uint64_t dt_supervisor_form_key | ( | const int | formid | ) |
Definition at line 209 of file supervisor.c.
References _form_key().
| void dt_supervisor_history | ( | const dt_sv_op_t | op, |
| const uint64_t | param_hash, | ||
| const char * | op_name, | ||
| const int | multi_priority, | ||
| const char * | multi_name, | ||
| const int | iop_order, | ||
| const int | history_index, | ||
| const int32_t | imgid, | ||
| const gboolean | enabled, | ||
| const dt_iop_module_t * | module, | ||
| const void * | params, | ||
| const dt_develop_blend_params_t * | blend_params, | ||
| GList * | forms | ||
| ) |
Definition at line 804 of file supervisor.c.
References _blendop_json(), _emit_line(), _entry_get_locked(), _envelope(), _forms_json(), _image_key(), _module_label(), _params_json(), _sv, _touch_alive_locked(), dt_sv_entry_t::alive, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_supervisor_active(), dt_supervisor_form(), DT_SV_F_HISTORY, DT_SV_UPDATE, dt_sv_entry_t::enabled, f, dt_sv_entry_t::facets, dt_sv_entry_t::history_index, dt_sv_entry_t::img_filename, dt_sv_entry_t::imgid, dt_sv_entry_t::iop_order, dt_sv_entry_t::multi_name, dt_sv_entry_t::multi_priority, and dt_sv_entry_t::op_name.
Referenced by _remove_history_leaks(), dt_dev_add_history_item_ext(), dt_dev_history_free_history(), dt_dev_history_truncate(), and dt_dev_read_history_ext().
| void dt_supervisor_image | ( | const dt_sv_op_t | op, |
| const int32_t | imgid, | ||
| const dt_image_t * | img | ||
| ) |
Definition at line 1309 of file supervisor.c.
References _emit_line(), _entry_get_locked(), _envelope(), _image_key(), _image_properties_json(), _sv, _touch_alive_locked(), dt_sv_entry_t::alive, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_supervisor_active(), DT_SV_CREATE, DT_SV_F_IMAGE, dt_sv_entry_t::facets, dt_image_t::filename, dt_sv_entry_t::img_filename, dt_sv_entry_t::imgid, and key.
Referenced by _image_cache_reload_from_db(), dt_image_cache_deallocate(), and dt_mipmap_cache_allocate_dynamic().
| uint64_t dt_supervisor_image_key | ( | const int32_t | imgid | ) |
Definition at line 191 of file supervisor.c.
References _image_key().
Referenced by _rebuild_memory().
Definition at line 283 of file supervisor.c.
References _sv, dt_pthread_mutex_init(), and TRUE.
Referenced by dt_init().
| void dt_supervisor_mipmap | ( | dt_sv_op_t | op, |
| int32_t | imgid, | ||
| int | mip | ||
| ) |
Mipmap cache object event — keyed by dt_supervisor_mipmap_key(). create when the mipmap buffer is allocated/loaded, delete on eviction. It links to the image cache object (an image edge) rather than duplicating the dt_image_t.
Definition at line 1275 of file supervisor.c.
References _emit_line(), _entry_get_locked(), _envelope(), _image_key(), _mipmap_key(), _resolve_locked(), _set_hash_member(), _sv, _touch_alive_locked(), dt_sv_entry_t::alive, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_supervisor_active(), DT_SV_F_MIPMAP, dt_sv_entry_t::facets, dt_sv_entry_t::image_hash, dt_sv_entry_t::img_filename, dt_sv_entry_t::imgid, key, and dt_sv_entry_t::mip.
Referenced by dt_mipmap_cache_allocate_dynamic(), and dt_mipmap_cache_deallocate_dynamic().
| uint64_t dt_supervisor_mipmap_key | ( | const int32_t | imgid, |
| const int | mip | ||
| ) |
Definition at line 181 of file supervisor.c.
References _mipmap_key().
Referenced by _rebuild_memory().
| void dt_supervisor_node | ( | dt_sv_op_t | op, |
| uint64_t | node_hash, | ||
| uint64_t | param_hash, | ||
| uint64_t | predecessor_hash, | ||
| const char * | op_name, | ||
| int | multi_priority, | ||
| int | iop_order, | ||
| int | pipe_type, | ||
| int32_t | imgid | ||
| ) |
Pipeline topology node event — keyed by dt_supervisor_node_key().
param_hash is the committed piece->hash, which ties the node (and the cachelines it produces) to its history item;Definition at line 856 of file supervisor.c.
References _emit_line(), _entry_get_locked(), _envelope(), _hash_is_set(), _module_label(), _resolve_locked(), _sv, _touch_alive_locked(), dt_sv_entry_t::alive, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_supervisor_active(), DT_SV_F_NODE, dt_sv_entry_t::facets, dt_sv_entry_t::imgid, dt_sv_entry_t::iop_order, dt_sv_entry_t::multi_priority, dt_sv_entry_t::op_name, dt_sv_entry_t::param_hash, dt_sv_entry_t::pipe_type, and dt_sv_entry_t::pred_hash.
Referenced by _sync_pipe_nodes_from_history(), _sync_pipe_nodes_from_history_from_node(), dt_dev_pixelpipe_cleanup_nodes(), and dt_dev_pixelpipe_create_nodes().
| uint64_t dt_supervisor_node_key | ( | int | pipe_type, |
| const char * | op_name, | ||
| int | multi_priority | ||
| ) |
Stable identity of a pipeline topology node: a function of the pipe type and the module instance (op + multi_priority), independent of parameters or ROI. The producer (create_nodes) and the consumers (a cacheline declaring its producer) call this to agree on the same key. Never returns INVALID.
Definition at line 161 of file supervisor.c.
References _fnv1a().
Referenced by _sync_pipe_nodes_from_history(), _sync_pipe_nodes_from_history_from_node(), dt_dev_pixelpipe_cache_peek_gui(), dt_dev_pixelpipe_cleanup_nodes(), dt_dev_pixelpipe_create_nodes(), dt_dev_pixelpipe_process(), dt_dev_pixelpipe_process_rec(), dt_develop_blend_process(), and dt_develop_blend_process_cl().
Rekey: an object's hash changed in place (a pipeline cacheline rekeyed for reuse, or a history item overwritten so its parameter hash changed). Modelled as "delete old hash + add new hash": the old entry is marked alive == FALSE (emitting a delete with rekeyed_to), and the new entry inherits the old metadata and is created/revived (emitting a create with rekeyed_from). Domain-agnostic; the domain is derived from the old entry's facets.
Definition at line 1079 of file supervisor.c.
References _emit_line(), _entry_get_locked(), _hash_is_set(), _rekey_record(), _sv, dt_sv_entry_t::alive, dt_sv_entry_t::bb_bpp, dt_sv_entry_t::bb_h, dt_sv_entry_t::bb_w, dt_sv_entry_t::cl_name, dt_sv_entry_t::devid, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_supervisor_active(), DT_SV_CREATE, DT_SV_DELETE, dt_sv_entry_t::enabled, dt_sv_entry_t::facets, FALSE, dt_sv_entry_t::history_hash, dt_sv_entry_t::history_index, dt_sv_entry_t::imgid, dt_sv_entry_t::input_hash, dt_sv_entry_t::iop_order, dt_sv_entry_t::multi_name, dt_sv_entry_t::multi_priority, dt_sv_entry_t::node_hash, dt_sv_entry_t::op_name, dt_sv_entry_t::param_hash, dt_sv_entry_t::pipe_type, dt_sv_entry_t::roi_h, dt_sv_entry_t::roi_w, dt_sv_entry_t::size, and TRUE.
Referenced by _cache_try_rekey_reuse_locked(), dt_dev_add_history_item_ext(), and dt_dev_pixelpipe_cache_rekey().
| void dt_supervisor_set_recording | ( | const gboolean | on | ) |
Definition at line 305 of file supervisor.c.
References dt_supervisor_recording.
Referenced by _on_destroy(), _on_record_toggled(), and dt_gui_supervisor_window_show().
| void dt_supervisor_thumbnail | ( | dt_sv_op_t | op, |
| int32_t | imgid, | ||
| int | width, | ||
| int | height, | ||
| int | mip, | ||
| gboolean | success | ||
| ) |
Thumbnail generation event — a thumbnail widget fetching its mipmap (and the pipeline render behind it, which surfaces through the generic node/cacheline/ backbuf events of the thumbnail pipe). Keyed by a synthetic (imgid, mip) key.
Definition at line 1195 of file supervisor.c.
References _emit_line(), _entry_get_locked(), _envelope(), _mipmap_key(), _set_hash_member(), _sv, _thumb_key(), _touch_alive_locked(), dt_sv_entry_t::alive, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_supervisor_active(), DT_SV_F_THUMB, dt_sv_entry_t::facets, height, dt_sv_entry_t::img_filename, dt_sv_entry_t::imgid, key, dt_sv_entry_t::mip, dt_sv_entry_t::roi_h, dt_sv_entry_t::roi_w, size, dt_sv_entry_t::thumb_success, and width.
Referenced by _view_image_get_surface_internal().
| uint64_t dt_supervisor_thumbnail_key | ( | const int32_t | imgid, |
| const int | mip | ||
| ) |
Definition at line 171 of file supervisor.c.
References _thumb_key().
| void dt_supervisor_widget | ( | dt_sv_op_t | op, |
| const char * | widget_tag, | ||
| uint64_t | consumed_hash, | ||
| int | pipe_type, | ||
| int32_t | imgid | ||
| ) |
Widget paint event — declares the backbuf/cacheline hash the widget consumed. The module/history narrative is resolved from the registry memory.
Definition at line 1173 of file supervisor.c.
References _emit_line(), _envelope(), _resolve_locked(), _sv, dt_sv_entry_t::alive, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_supervisor_active(), DT_SV_F_WIDGET, dt_sv_entry_t::facets, FALSE, dt_sv_entry_t::param_hash, and TRUE.
Referenced by dt_dev_lock_pipe_surface().
| struct { ... } _sv |
Referenced by _describe_edge(), _entry_get_locked(), _log_push(), _resolve_locked(), dt_supervisor_backbuf(), dt_supervisor_cache_wait(), dt_supervisor_cacheline_create(), dt_supervisor_cacheline_delete(), dt_supervisor_cacheline_read(), dt_supervisor_cleanup(), dt_supervisor_describe(), dt_supervisor_events_clear(), dt_supervisor_events_count(), dt_supervisor_events_snapshot(), dt_supervisor_events_snapshot_since(), dt_supervisor_form(), dt_supervisor_history(), dt_supervisor_image(), dt_supervisor_init(), dt_supervisor_mipmap(), dt_supervisor_node(), dt_supervisor_rekey(), dt_supervisor_thumbnail(), and dt_supervisor_widget().
| gint dt_supervisor_recording = 0 |
Definition at line 112 of file supervisor.c.
Referenced by _emit_line(), dt_supervisor_active(), and dt_supervisor_set_recording().
| GHashTable* entries |
Definition at line 116 of file supervisor.c.
Referenced by _combobox_next_sensitive(), _shortcut_search_save_recent_entry(), _table_to_list(), dt_mipmap_cache_get_usage(), dt_pwstorage_kwallet_get(), and update_menu_entries().
| gboolean inited |
Definition at line 120 of file supervisor.c.
| dt_pthread_mutex_t lock |
Definition at line 119 of file supervisor.c.
Referenced by _display_datetime(), _non_thread_safe_cache_ref_count_entry(), dt_accels_new_action_shortcut(), dt_accels_new_widget_shortcut(), dt_dev_pixelpipe_cache_rdlock_entry(), dt_dev_pixelpipe_cache_ref_count_entry(), dt_dev_pixelpipe_cache_wrlock_entry(), dt_exif_write_blob(), dt_exif_xmp_attach_export(), dt_exif_xmp_read_string(), dt_exif_xmp_write_with_imgpath(), dt_pthread_rwlock_destroy(), dt_pthread_rwlock_init(), and dt_pthread_rwlock_set_name().
| GQueue* log |
Definition at line 117 of file supervisor.c.
Referenced by _get_auto_exp(), _process_histogram(), gamma2(), gaussian_sampler(), igamma2(), log_gamma_lanczos(), log_gamma_windschitl(), nfa(), and process().
| uint64_t next_seq |
Definition at line 118 of file supervisor.c.