Skip to contentSkip to conversation

stats: Add wikipedia links to get_trimean() and get_iqm()

PATCH In review Damien Lespiau 4 participants 7 messages Jul 1, 2015 – Jul 2, 2015 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 stats: Add wikipedia links to get_trimean() and get_iqm()

Useful knowledge for anyone looking at the documentation and following the linkes.

---
 lib/igt_stats.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
lib/igt_stats.c +7 -2
index b7053c3..70650ec 100644
@@ -496,11 +496,15 @@ double igt_stats_get_std_deviation(igt_stats_t *stats)
  * igt_stats_get_iqm:
  * @stats: An #igt_stats_t instance
  *
- * Retrieves the interquartile mean of the @stats dataset.
+ * Retrieves the
+ * [interquartile mean](https://en.wikipedia.org/wiki/Interquartile_mean) (IQM)
+ * of the @stats dataset.
  *
  * The interquartile mean is a "statistical measure of central tendency".
  * It is a truncated mean that discards the lowest and highest 25% of values,
  * and calculates the mean value of the remaining central values.
+ *
+ * It's useful to hide outliers in measurements (due to cold cache etc).
  */
 double igt_stats_get_iqm(igt_stats_t *stats)
 {
@@ -533,7 +537,8 @@ double igt_stats_get_iqm(igt_stats_t *stats)
  * igt_stats_get_trimean:
  * @stats: An #igt_stats_t instance
  *
- * Retrieves the trimean of the @stats dataset.
+ * Retrieves the [trimean](https://en.wikipedia.org/wiki/Trimean) of the @stats
+ * dataset.
  *
  * The trimean is a the most efficient 3-point L-estimator, even more
  * robust than the median at estimating the average of a sample population.
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 2/4 aux: Don't evaluate several times the arguments of min() and max()

---
 lib/igt_aux.h | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
lib/igt_aux.h +10 -2
index 9ea50de..2979314 100644
@@ -91,8 +91,16 @@ void intel_require_memory(uint32_t count, uint32_t size, unsigned mode);
 #define CHECK_SWAP 0x2
 
 
-#define min(a, b) ((a) < (b) ? (a) : (b))
-#define max(a, b) ((a) > (b) ? (a) : (b))
+#define min(a, b) ({			\
+	typeof(a) _a = (a);		\
+	typeof(b) _b = (b);		\
+	_a < _b ? _a : _b;		\
+})
+#define max(a, b) ({			\
+	typeof(a) _a = (a);		\
+	typeof(b) _b = (b);		\
+	_a > _b ? _a : _b;		\
+})
 
 #define igt_swap(a, b) do {	\
 	typeof(a) _tmp = (a);	\
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH 3/4 build: Add DEBUG_FLAGS to tools and self-tests

In reply to Damien Lespiau

Makes using GDB better on those binaries.

---
 lib/tests/Makefile.am | 2 +-
 tools/Makefile.am     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
lib/tests/Makefile.am +1 -1
index 938d2ab..f09d2fe 100644
@@ -6,7 +6,7 @@ AM_TESTS_ENVIRONMENT = \
 
 EXTRA_DIST = $(check_SCRIPTS)
 
-AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) \
+AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS) \
 	-I$(srcdir)/../.. \
 	-I$(srcdir)/.. \
 	-include "$(srcdir)/../../lib/check-ndebug.h" \
tools/Makefile.am +1 -1
index 8288248..da971c3 100644
@@ -7,6 +7,6 @@ SUBDIRS += quick_dump
 endif
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS)
+AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS)
 LDADD = $(top_builddir)/lib/libintel_tools.la $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(LIBUDEV_LIBS) $(LIBUNWIND_LIBS) -lm
 
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH 4/4 build: Add an option to not use the git hash in version

In reply to Damien Lespiau

When developing, it's quite annoying that the version changes every commit, causing the library to be rebuild and everything single binary re-linked.

Add a config option to skip that.

I remember Ville asking for this "feature" as well.

---
 configure.ac         | 7 +++++++
 lib/Makefile.sources | 5 +++++
 2 files changed, 12 insertions(+)
configure.ac +7 -0
index 4208f00..caa3f50 100644
@@ -212,6 +212,13 @@ if test "x$enable_debug" = xyes; then
 	AC_SUBST([DEBUG_CFLAGS])
 fi
 
+# prevent relinking the world on every commit for developpers
+AC_ARG_ENABLE(skip-version,
+	      AS_HELP_STRING([--enable-skip-version],
+			     [Do not use git hash in version]),
+	      [skip_version=$enableval], [skip_version=no])
+AM_CONDITIONAL(SKIP_VERSION, [test "x$skip_version" = xyes])
+
 # -----------------------------------------------------------------------------
 
 # To build multithread code, gcc uses -pthread, Solaris Studio cc uses -mt
lib/Makefile.sources +5 -0
index f8a1b92..2148684 100644
@@ -60,6 +60,10 @@ libintel_tools_la_SOURCES = 	\
 
 .PHONY: version.h.tmp
 
+if SKIP_VERSION
+$(IGT_LIB_PATH)/version.h.tmp:
+	@echo '#define IGT_GIT_SHA1 "SKIP"' >> $@
+else
 $(IGT_LIB_PATH)/version.h.tmp:
 	@touch $@
 	@if test -d $(GPU_TOOLS_PATH)/.git; then \
@@ -73,6 +77,7 @@ $(IGT_LIB_PATH)/version.h.tmp:
 	else \
 		echo '#define IGT_GIT_SHA1 "NOT-GIT"' ; \
 	fi >> $@
+endif # SKIP_VERSION
 
 
 $(IGT_LIB_PATH)/version.h: $(IGT_LIB_PATH)/version.h.tmp
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

Re: [PATCH i-g-t 4/4] build: Add an option to not use the git hash in version

Quoted 7 lines · Damien Lespiau

When developing, it's quite annoying that the version changes every commit, causing the library to be rebuild and everything single binary re-linked.

Add a config option to skip that.

I remember Ville asking for this "feature" as well.

Thank you. This has indeed been annoying me for a while.

Quoted 51 lines
---
 configure.ac         | 7 +++++++
 lib/Makefile.sources | 5 +++++
 2 files changed, 12 insertions(+)
configure.ac +7 -0
index 4208f00..caa3f50 100644
@@ -212,6 +212,13 @@ if test "x$enable_debug" = xyes; then
 	AC_SUBST([DEBUG_CFLAGS])
 fi
 
+# prevent relinking the world on every commit for developpers
+AC_ARG_ENABLE(skip-version,
+	      AS_HELP_STRING([--enable-skip-version],
+			     [Do not use git hash in version]),
+	      [skip_version=$enableval], [skip_version=no])
+AM_CONDITIONAL(SKIP_VERSION, [test "x$skip_version" = xyes])
+
 # -----------------------------------------------------------------------------
 
 # To build multithread code, gcc uses -pthread, Solaris Studio cc uses -mt
lib/Makefile.sources +5 -0
index f8a1b92..2148684 100644
@@ -60,6 +60,10 @@ libintel_tools_la_SOURCES = 	\
 
 .PHONY: version.h.tmp
 
+if SKIP_VERSION
+$(IGT_LIB_PATH)/version.h.tmp:
+	@echo '#define IGT_GIT_SHA1 "SKIP"' >> $@
+else
 $(IGT_LIB_PATH)/version.h.tmp:
 	@touch $@
 	@if test -d $(GPU_TOOLS_PATH)/.git; then \
@@ -73,6 +77,7 @@ $(IGT_LIB_PATH)/version.h.tmp:
 	else \
 		echo '#define IGT_GIT_SHA1 "NOT-GIT"' ; \
 	fi >> $@
+endif # SKIP_VERSION
 
 
 $(IGT_LIB_PATH)/version.h: $(IGT_LIB_PATH)/version.h.tmp
Signature · 1 line
2.1.0
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

Re: [PATCH i-g-t 4/4] build: Add an option to not use the git hash in version

Quoted 10 lines · Ville Syrjälä
Quoted 7 lines · Damien Lespiau

When developing, it's quite annoying that the version changes every commit, causing the library to be rebuild and everything single binary re-linked.

Add a config option to skip that.

I remember Ville asking for this "feature" as well.

Thank you. This has indeed been annoying me for a while.

I hadn't noticed, I only build the lib/ if a test fails to link. -Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

Re: [PATCH i-g-t 4/4] build: Add an option to not use the git hash in version

In reply to Damien Lespiau
Quoted 2 lines · Damien Lespiau

When developing, it's quite annoying that the version changes every commit, causing the library to be rebuild and everything single binary

everything → every

Quoted 18 lines

re-linked.

Add a config option to skip that.

I remember Ville asking for this "feature" as well.

---
 configure.ac         | 7 +++++++
 lib/Makefile.sources | 5 +++++
 2 files changed, 12 insertions(+)
configure.ac +0 -0
index 4208f00..caa3f50 100644

configure.ac if test "x$enable_debug" = xyes; then · line 215

Quoted 4 lines
configure.ac +1 -0
@@ -212,6 +212,13 @@ if test "x$enable_debug" = xyes; then
        AC_SUBST([DEBUG_CFLAGS])
 fi
 
+# prevent relinking the world on every commit for developpers

"developers"

configure.ac if test "x$enable_debug" = xyes; then · line 216

Quoted 1 line
configure.ac +1 -0
+AC_ARG_ENABLE(skip-version,

I wonder whether "git-hash" would be more obvious here, so "--disable-git-hash" would turn off the git hash in version output.

Quoted 13 lines
configure.ac +5 -0
+             AS_HELP_STRING([--enable-skip-version],
+                            [Do not use git hash in version]),
+             [skip_version=$enableval], [skip_version=no])
+AM_CONDITIONAL(SKIP_VERSION, [test "x$skip_version" = xyes])
+
 # -----------------------------------------------------------------------------
 
 # To build multithread code, gcc uses -pthread, Solaris Studio cc uses -mt
lib/Makefile.sources +0 -0
index f8a1b92..2148684 100644

lib/Makefile.sources libintel_tools_la_SOURCES = \ · line 65

Quoted 6 lines
lib/Makefile.sources +3 -0
@@ -60,6 +60,10 @@ libintel_tools_la_SOURCES =  \
 
 .PHONY: version.h.tmp
 
+if SKIP_VERSION
+$(IGT_LIB_PATH)/version.h.tmp:
+       @echo '#define IGT_GIT_SHA1 "SKIP"' >> $@

Perhaps just "git", so the version output appears as (for example) "1.11-git", rather than "1.11-SKIP".

Quoted 15 lines
lib/Makefile.sources +2 -1
+else
 $(IGT_LIB_PATH)/version.h.tmp:
        @touch $@
        @if test -d $(GPU_TOOLS_PATH)/.git; then \
@@ -73,6 +77,7 @@ $(IGT_LIB_PATH)/version.h.tmp:
        else \
                echo '#define IGT_GIT_SHA1 "NOT-GIT"' ; \
        fi >> $@
+endif # SKIP_VERSION
 
 
 $(IGT_LIB_PATH)/version.h: $(IGT_LIB_PATH)/version.h.tmp
--

2.1.0

Quoted 4 lines

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx