mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 08:40:19 +00:00
removed perf tool
It was almost never used since added.
This commit is contained in:
@@ -38,7 +38,6 @@ DYLIBBUNDLER = @DYLIBBUNDLER@
|
||||
DYLIBBUNDLER_FLAGS += @DYLIBBUNDLER_FLAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
TARGET = bin/uv$(EXEEXT)
|
||||
PERF = bin/uv_perf
|
||||
BUNDLE = uv.app
|
||||
GUI_BUNDLE = gui/QT/uv-qt.app
|
||||
DXT_GLSL_CFLAGS = @DXT_GLSL_CFLAGS@
|
||||
@@ -83,7 +82,6 @@ COMMON_OBJS = \
|
||||
src/host.o \
|
||||
src/keyboard_control.o \
|
||||
src/messaging.o \
|
||||
src/perf.o \
|
||||
src/playback.o \
|
||||
src/ntp.o \
|
||||
src/pdb.o \
|
||||
@@ -580,7 +578,6 @@ clean:
|
||||
$(COND_SILENCE)-rm -f data/ag_plugin/uvReceiverService.zip data/ag_plugin/uvSenderService.zip
|
||||
$(COND_SILENCE)-rm -rf $(BUNDLE)
|
||||
$(COND_SILENCE)-rm -rf $(GUI_BUNDLE)
|
||||
$(COND_SILENCE)-rm -rf $(PERF) src/uv_perf.o
|
||||
$(COND_SILENCE)-rm -rf $(REFLECTOR_TARGET) $(REFLECTOR_OBJS)
|
||||
$(COND_SILENCE)-rm -rf @LIB_OBJS@ @MODULES@ @LIB_GENERATED_HEADERS@
|
||||
$(COND_SILENCE)-rm -rf $(DEP_FILES)
|
||||
@@ -674,9 +671,6 @@ osx-gui-dmg:
|
||||
[ ! -f UltraGrid.dmg ] || rm UltraGrid.dmg
|
||||
hdiutil create -fs HFS+ -volname ULTRAGRID -srcdir $(GUI_BUNDLE) -format UDZO -imagekey zlib-level=9 -o UltraGrid.dmg
|
||||
|
||||
perf: src/tv.o src/crypto/random.o
|
||||
$(CC) $(CFLAGS) -DPERF src/uv_perf.c src/crypto/random.o src/tv.o -o $(PERF)
|
||||
|
||||
@TARGETS@
|
||||
|
||||
install: all
|
||||
|
||||
@@ -78,7 +78,6 @@
|
||||
#include "../export.h" // not audio/export.h
|
||||
#include "host.h"
|
||||
#include "module.h"
|
||||
#include "perf.h"
|
||||
#include "rang.hpp"
|
||||
#include "rtp/audio_decoders.h"
|
||||
#include "rtp/fec.h"
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
#include "lib_common.h"
|
||||
#include "messaging.h"
|
||||
#include "module.h"
|
||||
#include "perf.h"
|
||||
#include "rang.hpp"
|
||||
#include "utils/color_out.h" // unit_evaluate
|
||||
#include "utils/misc.h" // unit_evaluate
|
||||
@@ -422,9 +421,6 @@ struct init_data *common_preinit(int argc, char *argv[])
|
||||
mtrace();
|
||||
#endif
|
||||
|
||||
perf_init();
|
||||
perf_record(UVP_INIT, 0);
|
||||
|
||||
load_libgcc();
|
||||
|
||||
return init;
|
||||
|
||||
85
src/perf.c
85
src/perf.c
@@ -1,85 +0,0 @@
|
||||
/**
|
||||
* @file perf.c
|
||||
* @author Martin Pulec <pulec@cesnet.cz>
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2011 CESNET, z. s. p. o.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, is permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of CESNET nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
|
||||
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
* EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined PERF && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
|
||||
|
||||
#include "config.h"
|
||||
#include "config_unix.h"
|
||||
#include "config_win32.h"
|
||||
#include "debug.h"
|
||||
#include "perf.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
#include <string.h>
|
||||
|
||||
static volatile size_t _uvp_offset;
|
||||
static int _uvp_id;
|
||||
static char *_uvp_shm;
|
||||
|
||||
void perf_init()
|
||||
{
|
||||
_uvp_id = shmget(_uvp_key, BUFFER_LEN, IPC_CREAT | 0666);
|
||||
_uvp_shm = shmat(_uvp_id, NULL, 0);
|
||||
_uvp_offset = 0;
|
||||
}
|
||||
|
||||
void perf_record(_uvp_event_t event, _uvp_arg_t arg)
|
||||
{
|
||||
size_t current;
|
||||
struct timeval tv;
|
||||
char *ptr;
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
current = __sync_fetch_and_add(&_uvp_offset, ENTRY_LEN);
|
||||
if(current == BUFFER_LEN)
|
||||
{
|
||||
_uvp_offset = 0;
|
||||
current = 0;
|
||||
} else if (current > BUFFER_LEN) {
|
||||
while((current = __sync_fetch_and_add(&_uvp_offset, ENTRY_LEN)) > BUFFER_LEN)
|
||||
;
|
||||
}
|
||||
ptr = _uvp_shm + current;
|
||||
((struct _uvp_entry *) ptr)->tv_sec = tv.tv_sec;
|
||||
((struct _uvp_entry *) ptr)->tv_usec = tv.tv_usec;
|
||||
((struct _uvp_entry *) ptr)->event = event;
|
||||
((struct _uvp_entry *) ptr)->arg = arg;
|
||||
}
|
||||
|
||||
#endif /* PERF && __GNUC__ */
|
||||
84
src/perf.h
84
src/perf.h
@@ -1,84 +0,0 @@
|
||||
/**
|
||||
* @file perf.
|
||||
* @author Martin Pulec <martin.pulec@cesnet.cz>
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2011 CESNET, z. s. p. o.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, is permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of CESNET nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
|
||||
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
* EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _PERF_H
|
||||
#define _PERF_H
|
||||
|
||||
|
||||
#include "config.h"
|
||||
#include "config_unix.h"
|
||||
#include "config_win32.h"
|
||||
|
||||
/* Public API */
|
||||
#define UVP_INIT 1
|
||||
#define UVP_GETFRAME 2
|
||||
#define UVP_PUTFRAME 3
|
||||
#define UVP_DECODEFRAME 4
|
||||
#define UVP_SEND 5
|
||||
#define UVP_CREATEPBUF 6
|
||||
|
||||
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && defined PERF
|
||||
|
||||
typedef uint32_t _uvp_event_t;
|
||||
typedef int64_t _uvp_arg_t;
|
||||
|
||||
void perf_init(void);
|
||||
|
||||
/* Private section */
|
||||
struct _uvp_entry {
|
||||
long int tv_sec;
|
||||
long int tv_usec;
|
||||
_uvp_event_t event;
|
||||
_uvp_arg_t arg;
|
||||
};
|
||||
|
||||
#define ENTRY_LEN sizeof(struct _uvp_entry)
|
||||
#define BUFFER_LEN (ENTRY_LEN * 512)
|
||||
|
||||
static key_t _uvp_key = 5043;
|
||||
|
||||
void perf_record(_uvp_event_t event, _uvp_arg_t arg);
|
||||
|
||||
#else
|
||||
|
||||
#define perf_record(x,y) {}
|
||||
#define perf_init() {}
|
||||
|
||||
#endif /* __GNUC__ && PERF */
|
||||
|
||||
#endif /* _PERF_H */
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
#include "host.h"
|
||||
#include "lib_common.h"
|
||||
#include "module.h"
|
||||
#include "perf.h"
|
||||
#include "tv.h"
|
||||
#include "rtp/fec.h"
|
||||
#include "rtp/rtp.h"
|
||||
|
||||
@@ -60,7 +60,6 @@
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "debug.h"
|
||||
#include "perf.h"
|
||||
#include "rtp/rtp.h"
|
||||
#include "rtp/rtp_callback.h"
|
||||
#include "rtp/ptime.h"
|
||||
@@ -276,9 +275,6 @@ static void add_coded_unit(struct pbuf_node *node, rtp_packet * pkt)
|
||||
|
||||
static struct pbuf_node *create_new_pnode(rtp_packet * pkt, long long playout_delay_us)
|
||||
{
|
||||
|
||||
perf_record(UVP_CREATEPBUF, pkt->ts);
|
||||
|
||||
struct pbuf_node *tmp = calloc(1, sizeof(struct pbuf_node));
|
||||
if (tmp != NULL) {
|
||||
tmp->magic = PBUF_MAGIC;
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
#endif // HAVE_CONFIG_H
|
||||
|
||||
#include "debug.h"
|
||||
#include "perf.h"
|
||||
#include "rtp/rtp.h"
|
||||
#include "rtp/rtp_callback.h"
|
||||
#include "rtp/pbuf.h"
|
||||
|
||||
@@ -107,7 +107,6 @@
|
||||
#include "lib_common.h"
|
||||
#include "messaging.h"
|
||||
#include "module.h"
|
||||
#include "perf.h"
|
||||
#include "rang.hpp"
|
||||
#include "rtp/fec.h"
|
||||
#include "rtp/rtp.h"
|
||||
@@ -1513,8 +1512,6 @@ int decode_video_frame(struct coded_data *cdata, void *decoder_data, struct pbuf
|
||||
int pt = 0;
|
||||
bool buffer_swapped = false;
|
||||
|
||||
perf_record(UVP_DECODEFRAME, cdata);
|
||||
|
||||
// We have no framebuffer assigned, exitting
|
||||
if(!decoder->display) {
|
||||
vf_free(frame);
|
||||
|
||||
@@ -69,7 +69,6 @@
|
||||
#include "debug.h"
|
||||
#include "host.h"
|
||||
#include "lib_common.h"
|
||||
#include "perf.h"
|
||||
#include "crypto/openssl_encrypt.h"
|
||||
#include "module.h"
|
||||
#include "rang.hpp"
|
||||
@@ -633,8 +632,6 @@ tx_send_base(struct tx *tx, struct video_frame *frame, struct rtp *rtp_session,
|
||||
|
||||
tx_update(tx, frame, substream);
|
||||
|
||||
perf_record(UVP_SEND, ts);
|
||||
|
||||
if (frame->fec_params.type == FEC_NONE) {
|
||||
hdrs_len += (sizeof(video_payload_hdr_t));
|
||||
rtp_hdr_len = sizeof(video_payload_hdr_t);
|
||||
@@ -776,7 +773,6 @@ void audio_tx_send(struct tx* tx, struct rtp *rtp_session, const audio_frame2 *
|
||||
fec_check_messages(tx);
|
||||
|
||||
timestamp = get_local_mediatime();
|
||||
perf_record(UVP_SEND, timestamp);
|
||||
|
||||
for (int channel = 0; channel < buffer->get_channel_count(); ++channel)
|
||||
{
|
||||
|
||||
107
src/uv_perf.c
107
src/uv_perf.c
@@ -1,107 +0,0 @@
|
||||
/**
|
||||
* @file uv_perf.c
|
||||
* @author Martin Pulec <pulec@cesnet.cz>
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2011-2012 CESNET, z. s. p. o.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, is permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of CESNET nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
|
||||
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
* EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "config_unix.h"
|
||||
#include "config_win32.h"
|
||||
#include "debug.h"
|
||||
#include "perf.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
struct message {
|
||||
const char * msg;
|
||||
const char * argtype;
|
||||
};
|
||||
|
||||
static const struct message messages[] = {
|
||||
[UVP_INIT] = { "Profiling tool initialized", "" },
|
||||
[UVP_GETFRAME] = { "Frame get", "display address" },
|
||||
[UVP_PUTFRAME] = { "Frame put", "frame address (UNUSED!)" },
|
||||
[UVP_DECODEFRAME] = { "Decode frame", "frame address" },
|
||||
[UVP_SEND] = { "TX Send", "timestamp" },
|
||||
[UVP_CREATEPBUF] = { "RX Received (first packet)", "timestamp" },
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int id;
|
||||
volatile struct _uvp_entry *shm;
|
||||
volatile struct _uvp_entry *tmp;
|
||||
struct timeval tv_old;
|
||||
struct timeval tv_cur;
|
||||
|
||||
tv_old.tv_sec = 0;
|
||||
tv_old.tv_usec = 0;
|
||||
|
||||
id = shmget(_uvp_key, BUFFER_LEN, IPC_CREAT | 0666);
|
||||
shm = shmat(id, NULL, 0);
|
||||
tmp = shm;
|
||||
|
||||
memset((char *) shm, '\0', BUFFER_LEN);
|
||||
|
||||
while(1)
|
||||
{
|
||||
if(tmp == shm + BUFFER_LEN/ENTRY_LEN) {
|
||||
tmp = shm;
|
||||
}
|
||||
tv_cur.tv_sec = tmp->tv_sec;
|
||||
tv_cur.tv_usec = tmp->tv_usec;
|
||||
if(tv_gt(tv_old, tv_cur) && tv_diff_usec(tv_old, tv_cur) > 1000) /* 0.001 sec out of order is OK */
|
||||
//tmp->tv_usec < tv_old.tv_usec)
|
||||
{
|
||||
usleep(100000);
|
||||
continue;
|
||||
}
|
||||
tv_old.tv_sec = tmp->tv_sec;
|
||||
tv_old.tv_usec = tmp->tv_usec;
|
||||
|
||||
if(tmp->tv_sec != 0) {
|
||||
printf("%10ld %10ld%30s:\t%20lX (%s)\n", tmp->tv_sec, tmp->tv_usec, messages[tmp->event].msg, tmp->arg, messages[tmp->event].argtype);
|
||||
}
|
||||
tmp++;
|
||||
}
|
||||
shmdt(shm);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,6 @@
|
||||
#include "debug.h"
|
||||
#include "lib_common.h"
|
||||
#include "module.h"
|
||||
#include "perf.h"
|
||||
#include "tv.h"
|
||||
#include "utils/thread.h"
|
||||
#include "utils/color_out.h"
|
||||
@@ -343,7 +342,6 @@ struct video_frame *display_get_frame(struct display *d)
|
||||
free_message(msg, r);
|
||||
}
|
||||
|
||||
perf_record(UVP_GETFRAME, d);
|
||||
assert(d->magic == DISPLAY_MAGIC);
|
||||
if (d->postprocess) {
|
||||
return vo_postprocess_getf(d->postprocess);
|
||||
@@ -365,7 +363,6 @@ struct video_frame *display_get_frame(struct display *d)
|
||||
*/
|
||||
int display_put_frame(struct display *d, struct video_frame *frame, int flags)
|
||||
{
|
||||
perf_record(UVP_PUTFRAME, frame);
|
||||
assert(d->magic == DISPLAY_MAGIC);
|
||||
|
||||
if (!frame) {
|
||||
|
||||
Reference in New Issue
Block a user