Commit Graph

70 Commits

Author SHA1 Message Date
Marc Espie 6dc98fe7f0 Issue #6850: support for memory in the dashboard under OpenBSD. 2021-05-09 19:57:49 +02:00
Ell 9e0fdc8e2c app: allow recording GLIB log messages in performance logs
Add a new "Messages" boolean parameter to performance logs, which,
when set, records GLIB log messages in the performance log as
markers, with an accompanying sample capturing their backtrace.
This option is enabled by default.
2020-08-02 11:02:00 +03:00
Ell d11cbbbbc9 app: in GimpDashboard, fix progressive-performance-log env-var 2020-07-30 01:14:37 +03:00
Ell 146c234350 app: add progressive performance logs
Add an option to record progressive performance logs.  Progressive
logs contain complete information after each recorded sample, by
writing partial address maps at each sample, containing all new
addresses introduced by the sample.  Furthermore, when recording a
progressive log, the output stream is flushed after each sample.

This allows recording complete logs even in cases where they can't
be properly terminated, such as when GIMP crashes or freezes in the
middle of the log.

Progressive logs are disabled by default, since they potentially
increase the sampling cost.  They can be enabled through a toggle
in the log file-dialog, or through the
GIMP_PERFORMANCE_LOG_PROGRESSIVE environment varaible.
2020-07-30 01:03:38 +03:00
Ell 126002c5c9 app: allow controlling performance-log parameters through the UI
When recording a performance log, allow setting the log parametrs
through the file dialog.  Currently, this includes the sample
frequency, and the option to include backtraces.

These options are still controllable through the
GIMP_PERFORMANCE_LOG_SAMPLE_FREQUENCY and
GIMP_PERFORMANCE_LOG_BACKTRACE environment variables.  When set,
the variables override the values entered through the UI.
2020-07-30 01:03:37 +03:00
Jehan 8caef4ea0b app: fix cast bug.
When building (at least on 32-bit), fixes this warning:
> app/widgets/gimpdashboard.c:3840:58: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

Unsigned long long is specified in the C99 standard to be at least
64-bit. So it's normal that the compiler complains, as a cast from
unsigned long long to a pointer has chances to go very wrong.
Yet gimp_backtrace_get_frame_address() actually returns a guintptr which
is type-compatible with gpointer so let's not give the compiler false
information and just use this type. Then cast it to unsigned long long
just for printing to dashboard log.
2020-04-20 01:35:59 +02:00
Ell f25a8934fa app: rename GimpParallelRunAsyncFunc to GimpRunAsyncFunc
... and move it to core-type.h, in preparation for next commit.
2020-03-14 00:43:43 +02:00
Alex Samorukov d8aa0d36a0 Add macOS support for the GIMP dashboard
(cherry picked from commit 215fd5195e)
2020-01-12 08:28:54 +01:00
Ell e92732f7cf app: add assigned-threads variable to the dashboard
Add an assigned-threads variable to the dashboard's misc group,
showing the number of worker threads which currently have work
assigned.  See commit
gegl@fc532f06773bd292c86abee31ac18f62e26d39df.
2019-07-23 17:15:15 +03:00
Ell 2cc77e6927 app: add active-thread variable to the dashboard
Add an active-thread variable to the dashboard's misc group,
showing the number of active worker threads.  See commit
gegl@6a3a6314d4d4cd668e0f6164afc0fde8b9c7c001.
2019-07-21 00:00:52 +03:00
Michael Natterer 86e07c16b5 app: start porting away from GtkAction and friends
Step one: get rid of all those deprecation warnings that make
it hard to see any other warnings:

- add a lot of dummy API to GimpAction, GimpActionGroup, GimpUIManager
  etc. which simply forwards to the deprecated GTK functions, they
  will all go away again later
- rename GimpAction to GimpActionImpl
- add interface GimpAction that is implemented by all action classes,
  creates a common interface and allows to remove some duplicated
  logic from GimpToggleAction and GimpRadioAction, and at the same
  time adds more features
2019-07-02 14:21:32 +02:00
Ell 088827e563 app: in GimpDashboard, improve legend logic 2019-05-11 05:14:23 -04:00
Ell cf54f790fd app: add tile-alloc-total variable to the dashboard
Add a tile-alloc-total varaible to the dashboard's memory and misc
groups, showing the total amount of memory used by the tile
allocator (see commit
gegl@137e66e45138e8316f6403e53e8aa9a02ad523e7.)
2019-05-08 04:22:39 -04:00
Ell 8434ae42a3 app: in GimpDashboard, don't show legend for groups with no meter
in GimpDashboard, don't show field legend colors in groups without
a meter.
2019-05-08 04:22:38 -04:00
Ell 652a2a90cf app: use independent async for resolving performance-log symbol information
... so that performance logs can be recorded during long-running
async operations, without those operations blocking the
finalization of the log.
2019-03-06 00:01:59 -05:00
Ell bb645bae17 app: add temp-buf-total varaible to the dashboard
Add a temp-buf-total variable to the dashboard's misc group,
showing the total size of all GimpTempBuf objects.
2019-02-22 08:47:05 -05:00
Ell 889e2e26ee app: remove gimp-scratch; replace with gegl-scratch
The scratch allocator has been moved to GEGL (commit
gegl@b99032d799dda3436ffa8c1cc28f8b0d34fb965d).  Remove gimp-
scratch, and replace all its uses with gegl-scratch.
2019-01-06 07:37:19 -05:00
Ell 626208b17c app: write floating-point vars using C locale in performance logs
When writing floating-point instrumentation variables in
performance logs, always use the C locale, rather than the current
locale.
2019-01-04 13:04:18 -05:00
Ell fda53f9c18 app: update definition of "{cache,swap}-compressed" dashboard vars
Update the definition of the "cache-compressed" and "swap-
compressed" dashboard variables, to reflect the changes made by
GEGL commit gegl@dc22e997757ab91c180244d5290d094d2ea8572f.
2018-12-17 06:39:59 -05:00
Ell 698d1af798 app: add scratch-total variable to the dashboard
Add a scratch-total variable to the dashboard's misc group, showing
the total amount of memory used by the scratch allocator.
2018-12-01 05:55:16 -05:00
Jehan 613bf7c5ab app, libgimpconfig: make various usage of g_file_replace() safer.
When an error occurs, we want to prevent overwriting any previous
version of the file by incomplete contents. So run
g_output_stream_close() with a cancelled GCancellable to do so.
See also discussion in #2565.
2018-11-26 15:50:38 +01:00
Ell c7f1730702 app: in performance logs, add new-lines between variable definitions 2018-11-10 02:52:31 -05:00
Ell eec1e1f189 app: a few fixes to performance-log backtrace output
Fix delta-encoding of performance-log backtraces in certain cases,
and distinguish between empty call-stacks and removed threads.
2018-11-07 14:26:15 -05:00
Ell 646208eff0 app: include variable descriptions in performance logs
Include instrumentation-variable descriptions in the var-defs
section of performance logs, so that they can be displayed
alongside their names when viewing the log.
2018-11-03 04:17:48 -04:00
Ell 3b0040c043 app, libgimp*, modules: don't use g_type_class_add_private() ...
... and G_TYPE_INSTANCE_GET_PRIVATE()

g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58.  Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.

This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.

Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
2018-09-18 14:39:56 -04:00
Ell 2c6b5c371e app: add more information to performance logs
In addition to the verbose GIMP version, include in performance
logs the values of all environment variables beginning with BABL_,
GEGL_, or GIMP_, and of all the GEGL config options.
2018-09-16 09:00:03 -04:00
Ell 78adb7c900 app, tools: add "running" thread attribute to GimpBacktrace/performance-log
The "running" attribute (readable through
gimp_backtrace_is_thread_running(), and recorded in the performance
log) specifies if the thread was in a running or suspended state at
the time the backtrace was taken.  It is accurate on Linux, but
only approximated on Windows.

Adapt the performance-log-expand.py tool to maintain this attribute
(and any future thread attributes we might add).
2018-09-03 18:30:10 -04:00
Ell a6ec857123 app: add source-location information to GimpBacktrace
Add source filename and line number fields to the
GimpBacktraceAddressInfo struct, populated through
gimp_backtrace_get_address_info().  This is not currently supported
by the Linux backend, but is supported by the Windows backend,
which we'll be added in the next commit.
2018-09-03 15:57:53 -04:00
Ell 422f6a55e4 app: more GimpBacktrace tidying
... in preparation for the Windows backend.
2018-09-03 15:57:53 -04:00
Ell 7ac87dc01e app: rename gimp_backtrace_get_symbol_info() to ..._get_address_info()
This function returns information about the given address, which
is currently mostly limited to the corresponding symbol
information, but we might want to add address-specific information
in the future, such as a line number.
2018-09-02 13:25:53 -04:00
Ell 36477bb287 app, icons, menus: add performance-log recording to the dashboard
Add an option to record a performance log through the dashboard.
The log contains a series of samples of the dashboard variables, as
well as the full program backtrace, when available.  As such, it
essentially acts as a built-in profiler, which allows us to
correlate program execution with the information available through
the dashboard.  It is meant to be used for creating logs to
accompany perofrmance-related bug reports, as well as for profiling
GIMP during development.

The sample frequency defaults to 10 samples per second, but can be
overridden using the GIMP_PERFORMANCE_LOG_SAMPLE_FREQUENCY
environment variable.  Backtraces are included by default when
available, but can be suppressed using the
GIMP_PERFORMANCE_LOG_NO_BACKTRACE environment variable.

Logs are created through the new "record" button at the bottom of
the dashboard dialog.  When pressed, a file dialog is opened to
select the log file, and, once confirmed, data is being recorded to
the selected file.  Recording is stopped by pressing the "record"
button again (we use a highlight to indicate that recording is
active.)

While recording, the "reset" button is replaced with an "add marker"
button, which can be used to add event markers to the log.  These
can be used to mark events of interest, such as "started painting"
and "stopped painting", which then appear in the log as part of the
sample stream.  Markers are numbered sequentually, and the number
of the next (to-be-added) marker appears on the button.  Shift-
clicking the button adds an empty (description-less) marker, which
is only identified by its number; this can be used when markers
need to be added quickly.

The log is an XML file, containing some extra information (such as
the output of "$ gimp -v", and symbol information) in addition to
the samples.  The data in the file is delta-encoded to reduce the
file size, meaning that samples (as well as some other elements)
only specify the changes since the previous sample.  This adds a
necessary decoding step before data can be processed; the next
commit adds a tool that does that.

There are currently no tools to actually analyze the data -- that's
still TBD -- but at least we can start gathering it.
2018-09-02 03:11:02 -04:00
Ell 1a20253b0c app: use gimp_gtk_container_clear() in GimpDashboard
... instead of doing the same thing ourselves.
2018-08-30 23:53:16 -04:00
Ell b3d27555ec app: remove unused function prototype in GimpDashboard 2018-08-30 23:46:41 -04:00
Ell d210199da5 app: fix dashboard swap read-throughput desc.; add translator comment 2018-08-26 15:13:40 -04:00
Ell 5446163e1d app: show swap read/write throughput in the dashboard
Show the read/write throughput of swap data in the corresponding
swap-group fields.
2018-08-19 03:34:47 -04:00
Ell cd54457d46 app: add "queued" field to the dashboard swap group
... which reports the amount of data queued for writing to the
swap (see GEGL commit 64021786ee067cf66c038622719acc590e6341db.)
When the swap queue is full, a yellow color underlay is shown in
the history graph.
2018-08-19 03:34:19 -04:00
Ell b6e552a74b app: add "compression" field to the swap dashboard group
The "compression" field reports the ratio between the total size of
the data in the swap, and the total size the data would have had if
all tiles in the swap occupied a unique data block.

See GEGL commit 185f4450f2a51690b39112973c61f894c1ec3e41.
2018-08-19 03:34:19 -04:00
Ell 8313a40fb5 app: show horizontal scrollbar in dashboard when necessary 2018-08-19 03:34:19 -04:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Ell aa382650a1 app: add active async-operations counter to the dashboard
Add an "async" field to the dashboard's "misc" group, showing the
number of async operations currently in the "running" state (i.e.,
all those GimpAsync objects for which gimp_async_finish[_full]() or
gimp_async_abort() haven't been called yet).
2018-07-01 13:52:21 -04:00
Ell 716510cb83 app: allow multiple variables as input to dashboard group-meter LED
When defining a dashboard group, allow specifying multiple
variables as input to the group meter's LED.  The LED is active
when any of the specified variables evaluates to TRUE, and its
color is the combination of the active variable colors.

Remove the swap-busy variable, and use swap-reading and
swap-writing as inputs to the swap group's LED instead, so that the
LED's color indicates whether the swap is currently being read-
from, written-to, or both.
2018-06-28 11:39:27 -04:00
Ell 19f4abbbd6 app: even more Windows-specific fixes in gimpdashboard.c
... and app/Makefile.am
2018-06-28 11:03:46 -04:00
Ell 4914103b5f app: more Windows-specific fixes in gimpdashboard.c 2018-06-28 10:18:31 -04:00
Ell d75e599431 app: s/DAta/Data/ in gimpdashboard.c 2018-06-28 05:05:58 -04:00
Piotr Drąg 6834af889e app: fix typo in a translatable string (trnasferred) 2018-06-24 19:31:59 +02:00
Ell 51793b114a app: fix dashboard swap read/write variable order
... to satisfy the inter-variable dependencies, so that the READING/
WRITING variables are based on the READ/WRITTEN values of the
current sample, and not the previous one.
2018-06-21 12:31:31 -04:00
Ell fda671841c app: more fixes to last dashboard commit
Don't show percentage for the swap read/written fields, and make
sure their history underlays are displayed correctly even if the
swap limit changes.
2018-06-21 07:39:09 -04:00
Ell ab9f70d95c app: a few fixes to last commit 2018-06-21 04:12:36 -04:00
Ell 6b9aba3067 app: add swap read/write fields to the dashboard
Add "read" and "written" fields to the dashboard swap group, which
report the total amount of data read-from/written-to the tile swap,
respetively.  These fields are non-active by default.  When these
fields are active, show a color underlay in the swap group's meter,
indicating when data was beging read-from/written-to the swap.

Improve the swap busy indicator (used as the meter's LED), so that
it's active whenever data has been read-from/written-to the swap
during the last sampling interval, rather than at the point of
sampling.
2018-06-21 04:00:59 -04:00
Ell dc6ea0a977 app: in the dashboard, fix statm file-descriptor initialization
... in the unlikely case that getting the page-size fails.
2018-06-19 13:41:35 -04:00