Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
profiling.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2010 Henrik Andersson.
4 Copyright (C) 2010-2011 johannes hanika.
5 Copyright (C) 2012 Richard Wonka.
6 Copyright (C) 2014, 2016 Tobias Ellinghaus.
7 Copyright (C) 2020 Pascal Obry.
8 Copyright (C) 2022 Martin Baƙinka.
9
10 darktable is free software: you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation, either version 3 of the License, or
13 (at your option) any later version.
14
15 darktable is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with darktable. If not, see <http://www.gnu.org/licenses/>.
22*/
23
24#pragma once
25
26#include "gui/gtk.h"
27
28
29#ifdef USE_DARKTABLE_PROFILING
30#define TIMER_START(name, description) \
31 dt_timer_t *name = dt_timer_start_with_name(__FILE__, __FUNCTION__, description)
32#else
33#define TIMER_START(name, description) \
34 { \
35 }
36#endif
37
38#ifdef USE_DARKTABLE_PROFILING
39#define TIMER_STOP(name) dt_timer_stop_with_name(name)
40#else
41#define TIMER_STOP(name) \
42 { \
43 }
44#endif
45
46#ifdef USE_DARKTABLE_PROFILING
47typedef struct dt_timer_t
48{
49 const char *file;
50 const char *function;
51 const char *description;
52 GTimer *timer;
53} dt_timer_t;
54
55dt_timer_t *dt_timer_start_with_name(const char *file, const char *function, const char *description);
56void dt_timer_stop_with_name(dt_timer_t *);
57#endif
58
59// clang-format off
60// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
61// vim: shiftwidth=2 expandtab tabstop=2 cindent
62// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
63// clang-format on
64
const char ** description(struct dt_iop_module_t *self)
Definition ashift.c:159
dt_timer_t * dt_timer_start_with_name(const char *file, const char *function, const char *description)
Definition profiling.c:27
void dt_timer_stop_with_name(dt_timer_t *t)
Definition profiling.c:37