Commit 413ed77f authored by Yi-Soo An's avatar Yi-Soo An Committed by Debarshi Ray

Migrate from EggCounter to DzlCounter

https://gitlab.gnome.org/GNOME/gnome-photos/issues/86
parent b1a69f4f
......@@ -26,7 +26,6 @@ AS_IF([test -n "$PACKAGE_COMMIT_ID"],
["$PACKAGE_COMMIT_ID"],
[Define to the description of this package's latest commit.])])
AC_CANONICAL_HOST
AC_PROG_CC
AC_PROG_CC_C_O
AC_HEADER_STDC
......@@ -91,13 +90,6 @@ if test "$have_langinfo_measurement" = "yes"; then
[Define if _NL_MEASUREMENT_MEASUREMENT is available])
fi
GB_ENABLE_RDTSCP
AS_IF([test "x$enable_rdtscp" = "xyes"], [CFLAGS="$CFLAGS -DEGG_HAVE_RDTSCP"])
AC_CHECK_FUNCS([sched_getcpu])
AC_CHECK_FUNCS([shm_open], [LIBRT=], [AC_CHECK_LIB([rt], [shm_open], [LIBRT=-lrt], [LIBRT=])])
AC_SUBST(LIBRT)
PKG_CHECK_MODULES(BABL, [babl])
PKG_CHECK_MODULES(CAIRO, [cairo >= $CAIRO_MIN_VERSION cairo-gobject])
PKG_CHECK_MODULES(DAZZLE, [libdazzle-1.0 >= $DAZZLE_MIN_VERSION])
......
#
# SYNOPSIS
#
# GB_ENABLE_RDTSCP
#
# DESCRIPTION
#
# Enables support for rdtscp counters as supported by egg-counter.
#
# Note: This may or may not override some variables such as CFLAGS.
#
# LICENSE
#
# Copyright (c) 2015 Christian Hergert <christian@hergert.me>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 1
AC_DEFUN([GB_ENABLE_RDTSCP], [
AC_ARG_ENABLE([rdtscp], [AC_HELP_STRING([--enable-rdtscp], [turn on rdtscp optimizations [default=no]])],
[enable_rdtscp=$enableval], [enable_rdtscp=no])
AS_IF([test "$enable_rdtscp" = "yes"], [
AC_MSG_CHECKING([for fast counters with rdtscp])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <x86intrin.h>
int main (int argc, char *argv[]) { int cpu; __builtin_ia32_rdtscp (&cpu); return 0; }
]])],
[enable_rdtscp=yes],
[enable_rdtscp=no])
AC_MSG_RESULT(["$enable_rdtscp"])
])
AS_CASE(["$host"],
[*-*-linux*],[CFLAGS="$CFLAGS -D_GNU_SOURCE"],
[])
])
......@@ -38,8 +38,6 @@ nodist_gnome_photos_SOURCES = \
$(NULL)
gnome_photos_SOURCES = \
egg-counter.c \
egg-counter.h \
photos-application.c \
photos-application.h \
photos-base-manager.c \
......@@ -316,8 +314,6 @@ nodist_gnome_photos_thumbnailer_SOURCES = \
$(NULL)
gnome_photos_thumbnailer_SOURCES = \
egg-counter.c \
egg-counter.h \
photos-debug.c \
photos-debug.h \
photos-error.c \
......@@ -461,6 +457,7 @@ gnome_photos_thumbnailer_LDFLAGS = \
gnome_photos_thumbnailer_LDADD = \
$(BABL_LIBS) \
$(DAZZLE_LIBS) \
$(GEGL_LIBS) \
$(GDK_PIXBUF_LIBS) \
$(GIO_LIBS) \
......
This diff is collapsed.
This diff is collapsed.
......@@ -38,7 +38,6 @@
#include <libgd/gd.h>
#include <tracker-sparql.h>
#include "egg-counter.h"
#include "photos-application.h"
#include "photos-base-item.h"
#include "photos-collection-icon-watcher.h"
......@@ -136,7 +135,7 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (PhotosBaseItem, photos_base_item, G_TYPE_OBJEC
photos_base_item_main_box_item_iface_init)
G_IMPLEMENT_INTERFACE (PHOTOS_TYPE_FILTERABLE,
photos_base_item_filterable_iface_init));
EGG_DEFINE_COUNTER (instances, "PhotosBaseItem", "Instances", "Number of PhotosBaseItem instances")
DZL_DEFINE_COUNTER (instances, "PhotosBaseItem", "Instances", "Number of PhotosBaseItem instances")
typedef struct _PhotosBaseItemMetadataAddSharedData PhotosBaseItemMetadataAddSharedData;
......@@ -2933,7 +2932,7 @@ photos_base_item_finalize (GObject *object)
G_OBJECT_CLASS (photos_base_item_parent_class)->finalize (object);
EGG_COUNTER_DEC (instances);
DZL_COUNTER_DEC (instances);
}
......@@ -3021,7 +3020,7 @@ photos_base_item_init (PhotosBaseItem *self)
{
PhotosBaseItemPrivate *priv;
EGG_COUNTER_INC (instances);
DZL_COUNTER_INC (instances);
priv = photos_base_item_get_instance_private (self);
......
......@@ -25,11 +25,11 @@
#include <string.h>
#include <dazzle.h>
#include <gio/gio.h>
#include <glib.h>
#include <tracker-sparql.h>
#include "egg-counter.h"
#include "photos-debug.h"
#include "photos-device-item.h"
#include "photos-enums.h"
......@@ -85,7 +85,7 @@ static void photos_item_manager_list_model_iface_init (GListModelInterface *ifac
G_DEFINE_TYPE_WITH_CODE (PhotosItemManager, photos_item_manager, PHOTOS_TYPE_BASE_MANAGER,
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, photos_item_manager_list_model_iface_init));
EGG_DEFINE_COUNTER (instances, "PhotosItemManager", "Instances", "Number of PhotosItemManager instances")
DZL_DEFINE_COUNTER (instances, "PhotosItemManager", "Instances", "Number of PhotosItemManager instances")
typedef struct _PhotosItemManagerHiddenItem PhotosItemManagerHiddenItem;
......@@ -1039,7 +1039,7 @@ photos_item_manager_finalize (GObject *object)
G_OBJECT_CLASS (photos_item_manager_parent_class)->finalize (object);
EGG_COUNTER_DEC (instances);
DZL_COUNTER_DEC (instances);
}
......@@ -1049,7 +1049,7 @@ photos_item_manager_init (PhotosItemManager *self)
GEnumClass *window_mode_class; /* TODO: use g_autoptr */
guint i;
EGG_COUNTER_INC (instances);
DZL_COUNTER_INC (instances);
self->collections = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
self->hidden_items = g_hash_table_new_full (g_str_hash,
......
......@@ -23,20 +23,20 @@
#include "config.h"
#include <dazzle.h>
#include <glib.h>
#include "egg-counter.h"
#include "photos-application.h"
#include "photos-debug.h"
#include "photos-remote-display-manager.h"
static void
photos_main_counter_arena_foreach (EggCounter *counter, gpointer user_data)
photos_main_counter_arena_foreach (DzlCounter *counter, gpointer user_data)
{
gint64 count;
count = egg_counter_get (counter);
count = dzl_counter_get (counter);
photos_debug (PHOTOS_DEBUG_MEMORY, "%s.%s = %" G_GINT64_FORMAT, counter->category, counter->name, count);
}
......@@ -44,7 +44,7 @@ photos_main_counter_arena_foreach (EggCounter *counter, gpointer user_data)
gint
main (gint argc, gchar *argv[])
{
EggCounterArena *counter_arena;
DzlCounterArena *counter_arena;
gint exit_status;
{
......@@ -61,8 +61,8 @@ main (gint argc, gchar *argv[])
exit_status = g_application_run (app, argc, argv);
}
counter_arena = egg_counter_arena_get_default ();
egg_counter_arena_foreach (counter_arena, photos_main_counter_arena_foreach, NULL);
counter_arena = dzl_counter_arena_get_default ();
dzl_counter_arena_foreach (counter_arena, photos_main_counter_arena_foreach, NULL);
return exit_status;
}
......@@ -23,10 +23,10 @@
#include "config.h"
#include <dazzle.h>
#include <glib.h>
#include <tracker-sparql.h>
#include "egg-counter.h"
#include "photos-debug.h"
#include "photos-offset-controller.h"
#include "photos-query-builder.h"
......@@ -52,7 +52,7 @@ static guint signals[LAST_SIGNAL] = { 0 };
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (PhotosOffsetController, photos_offset_controller, G_TYPE_OBJECT);
EGG_DEFINE_COUNTER (instances,
DZL_DEFINE_COUNTER (instances,
"PhotosOffsetController",
"Instances",
"Number of PhotosOffsetController instances")
......@@ -158,7 +158,7 @@ photos_offset_controller_finalize (GObject *object)
{
G_OBJECT_CLASS (photos_offset_controller_parent_class)->finalize (object);
EGG_COUNTER_DEC (instances);
DZL_COUNTER_DEC (instances);
}
......@@ -167,7 +167,7 @@ photos_offset_controller_init (PhotosOffsetController *self)
{
PhotosOffsetControllerPrivate *priv;
EGG_COUNTER_INC (instances);
DZL_COUNTER_INC (instances);
priv = photos_offset_controller_get_instance_private (self);
......
......@@ -22,9 +22,9 @@
#include <string.h>
#include <dazzle.h>
#include <glib.h>
#include "egg-counter.h"
#include "photos-debug.h"
#include "photos-gegl.h"
#include "photos-operation-insta-common.h"
......@@ -52,7 +52,7 @@ static void photos_pipeline_async_initable_iface_init (GAsyncInitableIface *ifac
G_DEFINE_TYPE_EXTENDED (PhotosPipeline, photos_pipeline, G_TYPE_OBJECT, 0,
G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, photos_pipeline_async_initable_iface_init));
EGG_DEFINE_COUNTER (instances, "PhotosPipeline", "Instances", "Number of PhotosPipeline instances")
DZL_DEFINE_COUNTER (instances, "PhotosPipeline", "Instances", "Number of PhotosPipeline instances")
static const gchar *OPERATIONS[] =
......@@ -247,7 +247,7 @@ photos_pipeline_finalize (GObject *object)
G_OBJECT_CLASS (photos_pipeline_parent_class)->finalize (object);
EGG_COUNTER_DEC (instances);
DZL_COUNTER_DEC (instances);
}
......@@ -281,7 +281,7 @@ photos_pipeline_set_property (GObject *object, guint prop_id, const GValue *valu
static void
photos_pipeline_init (PhotosPipeline *self)
{
EGG_COUNTER_INC (instances);
DZL_COUNTER_INC (instances);
self->hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
self->graph = gegl_node_new ();
......
......@@ -23,10 +23,10 @@
#include "config.h"
#include <dazzle.h>
#include <gio/gio.h>
#include <glib.h>
#include "egg-counter.h"
#include "photos-base-manager.h"
#include "photos-filterable.h"
#include "photos-search-context.h"
......@@ -51,7 +51,7 @@ static guint signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (PhotosSelectionController, photos_selection_controller, G_TYPE_OBJECT);
EGG_DEFINE_COUNTER (instances,
DZL_DEFINE_COUNTER (instances,
"PhotosSelectionController",
"Instances",
"Number of PhotosSelectionController instances")
......@@ -113,7 +113,7 @@ photos_selection_controller_finalize (GObject *object)
G_OBJECT_CLASS (photos_selection_controller_parent_class)->finalize (object);
EGG_COUNTER_DEC (instances);
DZL_COUNTER_DEC (instances);
}
......@@ -123,7 +123,7 @@ photos_selection_controller_init (PhotosSelectionController *self)
GApplication *app;
PhotosSearchContextState *state;
EGG_COUNTER_INC (instances);
DZL_COUNTER_INC (instances);
app = g_application_get_default ();
state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
......
......@@ -23,7 +23,8 @@
#include "config.h"
#include "egg-counter.h"
#include <dazzle.h>
#include "photos-filterable.h"
#include "photos-query.h"
#include "photos-source.h"
......@@ -58,7 +59,7 @@ static void photos_source_filterable_iface_init (PhotosFilterableInterface *ifac
G_DEFINE_TYPE_WITH_CODE (PhotosSource, photos_source, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (PHOTOS_TYPE_FILTERABLE,
photos_source_filterable_iface_init));
EGG_DEFINE_COUNTER (instances, "PhotosSource", "Instances", "Number of PhotosSource instances")
DZL_DEFINE_COUNTER (instances, "PhotosSource", "Instances", "Number of PhotosSource instances")
static const gchar *TRACKER_SCHEMA = "org.freedesktop.Tracker.Miner.Files";
......@@ -222,7 +223,7 @@ photos_source_finalize (GObject *object)
G_OBJECT_CLASS (photos_source_parent_class)->finalize (object);
EGG_COUNTER_DEC (instances);
DZL_COUNTER_DEC (instances);
}
......@@ -352,7 +353,7 @@ photos_source_set_property (GObject *object, guint prop_id, const GValue *value,
static void
photos_source_init (PhotosSource *self)
{
EGG_COUNTER_INC (instances);
DZL_COUNTER_INC (instances);
}
......
......@@ -19,19 +19,19 @@
#include "config.h"
#include <dazzle.h>
#include <glib.h>
#include "egg-counter.h"
#include "photos-debug.h"
#include "photos-thumbnailer.h"
static void
photos_thumbnailer_main_counter_arena_foreach (EggCounter *counter, gpointer user_data)
photos_thumbnailer_main_counter_arena_foreach (DzlCounter *counter, gpointer user_data)
{
gint64 count;
count = egg_counter_get (counter);
count = dzl_counter_get (counter);
photos_debug (PHOTOS_DEBUG_MEMORY, "%s.%s = %" G_GINT64_FORMAT, counter->category, counter->name, count);
}
......@@ -39,7 +39,7 @@ photos_thumbnailer_main_counter_arena_foreach (EggCounter *counter, gpointer use
gint
main (gint argc, gchar *argv[])
{
EggCounterArena *counter_arena;
DzlCounterArena *counter_arena;
GApplication *app;
gint exit_status = 0;
......@@ -51,8 +51,8 @@ main (gint argc, gchar *argv[])
exit_status = g_application_run (app, argc, argv);
g_object_unref (app);
counter_arena = egg_counter_arena_get_default ();
egg_counter_arena_foreach (counter_arena, photos_thumbnailer_main_counter_arena_foreach, NULL);
counter_arena = dzl_counter_arena_get_default ();
dzl_counter_arena_foreach (counter_arena, photos_thumbnailer_main_counter_arena_foreach, NULL);
return exit_status;
}
......@@ -23,12 +23,12 @@
#include "config.h"
#include <dazzle.h>
#include <glib.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
#include "egg-counter.h"
#include "photos-base-manager.h"
#include "photos-debug.h"
#include "photos-enums.h"
......@@ -81,7 +81,7 @@ static guint signals[LAST_SIGNAL] = { 0 };
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (PhotosTrackerController, photos_tracker_controller, G_TYPE_OBJECT);
EGG_DEFINE_COUNTER (instances,
DZL_DEFINE_COUNTER (instances,
"PhotosTrackerController",
"Instances",
"Number of PhotosTrackerController instances")
......@@ -518,7 +518,7 @@ photos_tracker_controller_finalize (GObject *object)
G_OBJECT_CLASS (photos_tracker_controller_parent_class)->finalize (object);
EGG_COUNTER_DEC (instances);
DZL_COUNTER_DEC (instances);
}
......@@ -554,7 +554,7 @@ photos_tracker_controller_init (PhotosTrackerController *self)
GApplication *app;
PhotosSearchContextState *state;
EGG_COUNTER_INC (instances);
DZL_COUNTER_INC (instances);
priv = photos_tracker_controller_get_instance_private (self);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment