[x265-commits] [x265] add support for VTune profiling with task indicators

Steve Borho steve at borho.org
Fri Jan 9 04:28:28 CET 2015


details:   http://hg.videolan.org/x265/rev/a04704062b6b
branches:  
changeset: 9052:a04704062b6b
user:      Steve Borho <steve at borho.org>
date:      Thu Jan 08 16:18:51 2015 +0530
description:
add support for VTune profiling with task indicators
Subject: [x265] slicetype: fix flush

details:   http://hg.videolan.org/x265/rev/fec3dc76ab62
branches:  
changeset: 9053:fec3dc76ab62
user:      Satoshi Nakagawa <nakagawa424 at oki.com>
date:      Thu Jan 08 19:04:04 2015 +0900
description:
slicetype: fix flush
Subject: [x265] fix bug in satd_4x4 for psyCost_ss

details:   http://hg.videolan.org/x265/rev/13bc567b48c5
branches:  
changeset: 9054:13bc567b48c5
user:      Divya Manivannan <divya at multicorewareinc.com>
date:      Thu Jan 08 14:00:17 2015 +0530
description:
fix bug in satd_4x4 for psyCost_ss
Subject: [x265] prof: add new scoped events for pmode and pme

details:   http://hg.videolan.org/x265/rev/53e722adccfb
branches:  
changeset: 9055:53e722adccfb
user:      Steve Borho <steve at borho.org>
date:      Fri Jan 09 08:05:08 2015 +0530
description:
prof: add new scoped events for pmode and pme
Subject: [x265] prof: cleanup profile integrations

details:   http://hg.videolan.org/x265/rev/febe8be758de
branches:  
changeset: 9056:febe8be758de
user:      Steve Borho <steve at borho.org>
date:      Fri Jan 09 08:26:27 2015 +0530
description:
prof: cleanup profile integrations

Move PPA and vtune into a profile/ folder and more cleanly share the list of
CPU scoped profile zones (events, tasks, whatever they are called)
Subject: [x265] rc: partial backout of 53e722adccfb, bad qrefresh

details:   http://hg.videolan.org/x265/rev/08429f82d30f
branches:  
changeset: 9057:08429f82d30f
user:      Steve Borho <steve at borho.org>
date:      Fri Jan 09 08:55:58 2015 +0530
description:
rc: partial backout of 53e722adccfb, bad qrefresh

diffstat:

 source/CMakeLists.txt               |   42 ++++++---
 source/PPA/CMakeLists.txt           |    1 -
 source/PPA/ppa.cpp                  |  147 ------------------------------------
 source/PPA/ppa.h                    |   43 ----------
 source/PPA/ppaApi.h                 |   70 -----------------
 source/PPA/ppaCPUEvents.h           |    6 -
 source/common/common.h              |    6 +-
 source/common/pixel.cpp             |   45 +++++-----
 source/encoder/analysis.cpp         |    2 +
 source/encoder/slicetype.cpp        |    5 +-
 source/encoder/slicetype.h          |    3 +-
 source/profile/CMakeLists.txt       |   25 ++++++
 source/profile/PPA/CMakeLists.txt   |    1 +
 source/profile/PPA/ppa.cpp          |  147 ++++++++++++++++++++++++++++++++++++
 source/profile/PPA/ppa.h            |   43 ++++++++++
 source/profile/PPA/ppaApi.h         |   70 +++++++++++++++++
 source/profile/cpuEvents.h          |    8 +
 source/profile/vtune/CMakeLists.txt |    2 +
 source/profile/vtune/vtune.cpp      |   49 ++++++++++++
 source/profile/vtune/vtune.h        |   52 ++++++++++++
 20 files changed, 462 insertions(+), 305 deletions(-)

diffs (truncated from 949 to 300 lines):

diff -r 4659aa3e33bf -r 08429f82d30f source/CMakeLists.txt
--- a/source/CMakeLists.txt	Thu Jan 08 14:58:35 2015 +0530
+++ b/source/CMakeLists.txt	Fri Jan 09 08:55:58 2015 +0530
@@ -56,10 +56,10 @@ else()
 endif()
 
 if(UNIX)
-    SET(PLATFORM_LIBS pthread)
+    list(APPEND PLATFORM_LIBS pthread)
     find_library(LIBRT rt)
     if(LIBRT)
-        set(PLATFORM_LIBS ${PLATFORM_LIBS} rt)
+        list(APPEND PLATFORM_LIBS rt)
     endif()
 endif(UNIX)
 
@@ -196,24 +196,13 @@ if(WARNINGS_AS_ERRORS)
     endif()
 endif(WARNINGS_AS_ERRORS)
 
-
-option(ENABLE_PPA "Enable PPA profiling instrumentation" OFF)
-if(ENABLE_PPA)
-    add_definitions(-DENABLE_PPA)
-    add_subdirectory(PPA)
-    SET(PLATFORM_LIBS ${PLATFORM_LIBS} PPA)
-    if(UNIX)
-        SET(PLATFORM_LIBS ${PLATFORM_LIBS} dl)
-    endif(UNIX)
-endif(ENABLE_PPA)
-
 if (WIN32)
     # Visual leak detector
     find_package(VLD QUIET)
     if(VLD_FOUND)
         add_definitions(-DHAVE_VLD)
         include_directories(${VLD_INCLUDE_DIRS})
-        set(PLATFORM_LIBS ${PLATFORM_LIBS} ${VLD_LIBRARIES})
+        list(APPEND PLATFORM_LIBS ${VLD_LIBRARIES})
         link_directories(${VLD_LIBRARY_DIRS})
     endif()
     option(WINXP_SUPPORT "Make binaries compatible with Windows XP" OFF)
@@ -226,6 +215,31 @@ endif()
 
 include(version) # determine X265_VERSION and X265_LATEST_TAG
 include_directories(. common encoder "${PROJECT_BINARY_DIR}")
+
+option(ENABLE_PPA "Enable PPA profiling instrumentation" OFF)
+if(ENABLE_PPA)
+    add_definitions(-DENABLE_PPA)
+    list(APPEND PLATFORM_LIBS PPA)
+    if(UNIX)
+        list(APPEND PLATFORM_LIBS dl)
+    endif(UNIX)
+    add_subdirectory(profile/PPA)
+endif(ENABLE_PPA)
+
+option(ENABLE_VTUNE "Enable Vtune profiling instrumentation" OFF)
+if(ENABLE_VTUNE)
+    add_definitions(-DENABLE_VTUNE)
+    include_directories($ENV{VTUNE_AMPLIFIER_XE_2015_DIR}/include)
+    list(APPEND PLATFORM_LIBS vtune)
+    link_directories($ENV{VTUNE_AMPLIFIER_XE_2015_DIR}/lib64)
+    if(WIN32)
+        list(APPEND PLATFORM_LIBS libittnotify.lib)
+    else()
+        list(APPEND PLATFORM_LIBS libittnotify.a dl)
+    endif()
+    add_subdirectory(profile/vtune)
+endif(ENABLE_VTUNE)
+
 add_subdirectory(encoder)
 add_subdirectory(common)
 
diff -r 4659aa3e33bf -r 08429f82d30f source/PPA/CMakeLists.txt
--- a/source/PPA/CMakeLists.txt	Thu Jan 08 14:58:35 2015 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-add_library(PPA ppa.h ppaApi.h ppaCPUEvents.h ppa.cpp)
diff -r 4659aa3e33bf -r 08429f82d30f source/PPA/ppa.cpp
--- a/source/PPA/ppa.cpp	Thu Jan 08 14:58:35 2015 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 2013 x265 project
- *
- * Authors: Steve Borho <steve at borho.org>
- *
- * 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 2 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, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
- *
- * This program is also available under a commercial proprietary license.
- * For more information, contact us at license @ x265.com.
- *****************************************************************************/
-
-#if defined(ENABLE_PPA)
-
-#include "ppa.h"
-#include <stdlib.h>
-
-#define PPA_REGISTER_CPU_EVENT2GROUP(x, y) # x, # y,
-#define PPA_REGISTER_CPU_EVENT(x) PPA_REGISTER_CPU_EVENT2GROUP(x, NoGroup)
-const char *PPACpuAndGroup[] =
-{
-#include "ppaCPUEvents.h"
-    ""
-};
-#undef PPA_REGISTER_CPU_EVENT
-#undef PPA_REGISTER_CPU_EVENT2GROUP
-
-extern "C" {
-typedef ppa::Base *(FUNC_PPALibInit)(const char **, int);
-typedef void (FUNC_PPALibRelease)(ppa::Base* &);
-}
-
-using namespace ppa;
-
-static FUNC_PPALibRelease *_pfuncPpaRelease;
-ppa::Base *ppa::ppabase;
-
-static void _ppaReleaseAtExit()
-{
-    _pfuncPpaRelease(ppabase);
-}
-
-#ifdef _WIN32
-#include <windows.h>
-
-#if defined(_M_X64) || defined(__x86_64__) || defined(__amd64__)
-# ifdef UNICODE
-# define PPA_DLL_NAME L"ppa64.dll"
-# else
-# define PPA_DLL_NAME "ppa64.dll"
-# endif
-#else
-# ifdef UNICODE
-# define PPA_DLL_NAME L"ppa.dll"
-# else
-# define PPA_DLL_NAME "ppa.dll"
-# endif
-#endif // if defined(_M_X64) || defined(__x86_64__) || defined(__amd64__)
-
-void initializePPA(void)
-{
-    if (ppabase)
-        return;
-
-    HMODULE _ppaLibHandle = LoadLibrary(PPA_DLL_NAME);
-    if (!_ppaLibHandle)
-        return;
-
-    FUNC_PPALibInit *_pfuncPpaInit = (FUNC_PPALibInit*)GetProcAddress(_ppaLibHandle, "InitPpaUtil");
-    _pfuncPpaRelease  = (FUNC_PPALibRelease*)GetProcAddress(_ppaLibHandle, "DeletePpa");
-
-    if (!_pfuncPpaInit || !_pfuncPpaRelease)
-    {
-        FreeLibrary(_ppaLibHandle);
-        return;
-    }
-
-    ppabase = _pfuncPpaInit(PPACpuAndGroup, PPACpuGroupNums);
-    if (!ppabase)
-    {
-        FreeLibrary(_ppaLibHandle);
-        return;
-    }
-
-    atexit(_ppaReleaseAtExit);
-}
-
-#else /* linux & unix & cygwin */
-#include <dlfcn.h>
-#include <stdio.h>
-
-#if defined(_M_X64) || defined(__x86_64__) || defined(__amd64__)
-# define PPA_LIB_NAME "libppa64.so"
-#else
-# define PPA_LIB_NAME "libppa.so"
-#endif
-
-void initializePPA(void)
-{
-    if (ppabase)
-    {
-        printf("PPA: already initialized\n");
-        return;
-    }
-
-    void *_ppaDllHandle = dlopen(PPA_LIB_NAME, RTLD_LAZY);
-    if (!_ppaDllHandle)
-    {
-        printf("PPA: Unable to load %s\n", PPA_LIB_NAME);
-        return;
-    }
-
-    FUNC_PPALibInit *_pfuncPpaInit = (FUNC_PPALibInit*)dlsym(_ppaDllHandle, "InitPpaUtil");
-    _pfuncPpaRelease = (FUNC_PPALibRelease*)dlsym(_ppaDllHandle, "DeletePpa");
-
-    if (!_pfuncPpaInit || !_pfuncPpaRelease)
-    {
-        printf("PPA: Function bindings failed\n");
-        dlclose(_ppaDllHandle);
-        return;
-    }
-
-    ppabase = _pfuncPpaInit(PPACpuAndGroup, PPACpuGroupNums);
-    if (!ppabase)
-    {
-        printf("PPA: Init failed\n");
-        dlclose(_ppaDllHandle);
-        return;
-    }
-
-    atexit(_ppaReleaseAtExit);
-}
-
-#endif /* !_WIN32 */
-
-#endif /* defined(ENABLE_PPA) */
diff -r 4659aa3e33bf -r 08429f82d30f source/PPA/ppa.h
--- a/source/PPA/ppa.h	Thu Jan 08 14:58:35 2015 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 2013 x265 project
- *
- * Authors: Steve Borho <steve at borho.org>
- *
- * 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 2 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, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
- *
- * This program is also available under a commercial proprietary license.
- * For more information, contact us at license @ x265.com.
- *****************************************************************************/
-
-#ifndef PPA_H
-#define PPA_H
-
-/* declare enum list of users CPU events */
-#define PPA_REGISTER_CPU_EVENT(x) x,
-enum PPACpuEventEnum
-{
-#include "ppaCPUEvents.h"
-    PPACpuGroupNums
-};
-#undef PPA_REGISTER_CPU_EVENT
-
-#include "ppaApi.h"
-
-void initializePPA();
-
-#define PPA_INIT()               initializePPA()
-#define PPAScopeEvent(e)         ppa::ProfileScope ppaScope_(e)
-
-#endif /* PPA_H */
diff -r 4659aa3e33bf -r 08429f82d30f source/PPA/ppaApi.h
--- a/source/PPA/ppaApi.h	Thu Jan 08 14:58:35 2015 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 2013 x265 project
- *
- * Authors: Steve Borho <steve at borho.org>
- *
- * 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 2 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, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
- *


More information about the x265-commits mailing list