build once more with the Tau profiler

This commit is contained in:
David Rose 2011-09-06 17:29:30 +00:00
parent 37bdfa9815
commit 59ec701a26
25 changed files with 62 additions and 71 deletions

View File

@ -907,7 +907,7 @@
#define TAU_MAKEFILE
#define TAU_ROOT
#define PDT_ROOT
#define TAU_OPTS -optKeepFiles
#define TAU_OPTS -optKeepFiles -optRevert
#define TAU_CFLAGS -D_GNU_SOURCE
#define USE_TAU

View File

@ -84,8 +84,9 @@
#set DEPENDABLE_HEADERS $[DEPENDABLE_HEADERS] $[filter %.h %.I %.T %_src.cxx,$[get_sources]] $[included_sources]
// Now compute the source files.
#define c_sources $[filter %.c,$[get_sources]]
#define cxx_sources $[filter-out %_src.cxx,$[filter %.cxx %.mm %.cpp,$[get_sources]]]
#define c_sources $[filter-out %_src.c,$[filter %.c,$[get_sources]]]
#define mm_sources $[filter %.mm,$[get_sources]]
#define cxx_sources $[filter-out %_src.cxx,$[filter %.cxx %.cpp,$[get_sources]]]
#define cxx_interrogate_sources
#if $[PYTHON_MODULE_ONLY]
#set cxx_interrogate_sources $[cxx_sources]
@ -96,7 +97,7 @@
#define lxx_sources $[filter %.lxx,$[get_sources]]
// Define what the object files are.
#foreach file $[c_sources] $[cxx_sources] $[cxx_interrogate_sources] $[yxx_sources] $[lxx_sources]
#foreach file $[c_sources] $[mm_sources] $[cxx_sources] $[cxx_interrogate_sources] $[yxx_sources] $[lxx_sources]
#define $[file]_obj $[patsubst %.c %.cxx %.mm %.cpp %.yxx %.lxx,$[ODIR]/$[obj_prefix]%$[OBJ],$[notdir $[file]]]
#push 1 $[file]_obj
#end file
@ -160,7 +161,7 @@
#set cxx_interrogate_sources $[cxx_interrogate_sources] $[generated_file]
#endif
#define compile_sources $[c_sources] $[cxx_sources] $[cxx_interrogate_sources]
#define compile_sources $[c_sources] $[mm_sources] $[cxx_sources] $[cxx_interrogate_sources]
#end metalib_target lib_target noinst_lib_target test_lib_target static_lib_target dynamic_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target

View File

@ -83,6 +83,10 @@
#define python_framework $[PYTHON_FRAMEWORK]
#endif
#if $[USE_TAU]
#define tau_ipath $[wildcard $[TAU_IPATH]]
#endif
#if $[HAVE_THREADS]
#define threads_ipath $[wildcard $[THREADS_IPATH]]
#define threads_lpath $[wildcard $[THREADS_LPATH]]
@ -697,7 +701,7 @@
// names only; the -I switch is not included here.
#defun get_ipath
// hack to add stl,python. should be removed
#define alt_ipath $[if $[IGNORE_LIB_DEFAULTS_HACK],,$[stl_ipath] $[python_ipath]]
#define alt_ipath $[if $[IGNORE_LIB_DEFAULTS_HACK],,$[stl_ipath] $[python_ipath] $[tau_ipath]]
#foreach package $[use_packages]
#set alt_ipath $[alt_ipath] $[$[package]_ipath]

View File

@ -341,7 +341,7 @@ igate : $[get_igatedb(metalib_target lib_target ss_lib_target)]
// various .obj files.
#define sources \
$[patsubst %,$[%_obj],$[c_sources] $[cxx_sources]]
$[patsubst %,$[%_obj],$[c_sources] $[mm_sources] $[cxx_sources]]
#define interrogate_sources \
$[patsubst %,$[%_obj],$[cxx_interrogate_sources]]
#define cc_ld $[or $[get_ld],$[CC]]
@ -656,7 +656,7 @@ $[TAB] $[compile_c]
// Rules to compile C++ files (static objects).
#foreach file $[sort $[cxx_sources] $[cxx_interrogate_sources]]
#foreach file $[sort $[mm_sources] $[cxx_sources] $[cxx_interrogate_sources]]
#define target $[$[file]_obj]
#define source $[file]
#define ipath $[target_ipath]
@ -697,7 +697,7 @@ $[TAB] $[compile_c]
// Rules to compile C++ files (shared objects).
#foreach file $[sort $[cxx_sources] $[cxx_interrogate_sources]]
#foreach file $[sort $[mm_sources] $[cxx_sources] $[cxx_interrogate_sources]]
#define target $[$[file]_obj]
#define source $[file]
#define ipath $[target_ipath]

View File

@ -12,15 +12,6 @@
//
////////////////////////////////////////////////////////////////////
#ifdef __APPLE__
#ifndef isnan
#define isnan(x) \
((sizeof(x) == sizeof(double)) ? \
__isnand(x) : \
(sizeof(x) == sizeof(float)) ? __isnanf(x) : __isnan(x))
#endif
#endif
#ifdef __INTEL_COMPILER
// see float.h
#define FPU_CONTROLWORD_WRITEMASK 0xFFFFF // if you look at defn of _CW_DEFAULT, all settings fall within 0xFFFFF

View File

@ -47,7 +47,7 @@ DeletedBufferChain(size_t buffer_size) {
void *DeletedBufferChain::
allocate(size_t size, TypeHandle type_handle) {
#ifdef USE_DELETED_CHAIN
TAU_PROFILE("void *DeletedBufferChain::allocate(size_t, TypeHandle)", " ", TAU_USER);
//TAU_PROFILE("void *DeletedBufferChain::allocate(size_t, TypeHandle)", " ", TAU_USER);
assert(size <= _buffer_size);
ObjectNode *obj;
@ -105,7 +105,7 @@ allocate(size_t size, TypeHandle type_handle) {
void DeletedBufferChain::
deallocate(void *ptr, TypeHandle type_handle) {
#ifdef USE_DELETED_CHAIN
TAU_PROFILE("void DeletedBufferChain::deallocate(void *, TypeHandle)", " ", TAU_USER);
//TAU_PROFILE("void DeletedBufferChain::deallocate(void *, TypeHandle)", " ", TAU_USER);
assert(ptr != (void *)NULL);
#ifdef DO_MEMORY_USAGE

View File

@ -20,6 +20,11 @@
#ifdef __cplusplus
#ifdef USE_TAU
// Tau provides this destructive version of stdbool.h that we must mask.
#define __PDT_STDBOOL_H_
#endif
#ifdef CPPPARSER
#include <iostream>
#include <string>

View File

@ -18,6 +18,10 @@
#include <errno.h>
#include <stdio.h> // for perror
#ifdef __APPLE__
#include <sys/param.h> // for realpath
#endif // __APPLE__
#ifdef WIN32_VC
// Windows requires this for getcwd().
#include <direct.h>

View File

@ -15,6 +15,7 @@
#include "collisionBox.h"
#include "collisionLine.h"
#include "collisionRay.h"
#include "collisionSphere.h"
#include "collisionSegment.h"
#include "collisionHandler.h"
#include "collisionEntry.h"

View File

@ -184,7 +184,11 @@ set_highest_collision(const NodePath &target_node_path, const NodePath &from_nod
// Add only the one that we're impacting with:
add_entry(highest);
} else {
_current_colliding.insert(valid_entries.begin(), valid_entries.end());
// Add all of them.
pvector<PT(CollisionEntry)>::iterator vi;
for (vi = valid_entries.begin(); vi != valid_entries.end(); ++vi) {
add_entry(*vi);
}
}

View File

@ -34,7 +34,7 @@
config_framework.cxx config_framework.h \
pandaFramework.cxx pandaFramework.I pandaFramework.h \
windowFramework.cxx windowFramework.I windowFramework.h \
shuttle_controls.bam.c
rock_floor.rgb_src.c shuttle_controls.bam_src.c
#define INSTALL_HEADERS \
pandaFramework.I pandaFramework.h \

View File

@ -58,12 +58,12 @@
// This is generated data for the standard texture we apply to the
// blue triangle.
#include "rock_floor.rgb.c"
#include "rock_floor.rgb_src.c"
// This is generated data for shuttle_controls.bam, a bamified version
// of shuttle_controls.egg (found in the models tree). It's
// compiled in shuttle_controls.bam.c.
#include "shuttle_controls.bam.c"
// compiled in shuttle_controls.bam_src.c.
#include "shuttle_controls.bam_src.c"
// This number is chosen arbitrarily to override any settings in model
// files.

View File

@ -120,6 +120,7 @@
antialiasAttrib.cxx \
attribNodeRegistry.cxx \
audioVolumeAttrib.cxx \
auxBitplaneAttrib.cxx \
auxSceneData.cxx \
bamFile.cxx \
billboardEffect.cxx \

View File

@ -26,7 +26,7 @@
////////////////////////////////////////////////////////////////////
void ConditionVarPosixImpl::
wait(double timeout) {
TAU_PROFILE("ConditionVarPosixImpl::wait()", " ", TAU_USER);
//TAU_PROFILE("ConditionVarPosixImpl::wait()", " ", TAU_USER);
struct timeval now;
gettimeofday(&now, NULL);

View File

@ -201,7 +201,7 @@ void *ThreadPosixImpl::
root_func(void *data) {
TAU_REGISTER_THREAD();
{
TAU_PROFILE("void ThreadPosixImpl::root_func()", " ", TAU_USER);
//TAU_PROFILE("void ThreadPosixImpl::root_func()", " ", TAU_USER);
ThreadPosixImpl *self = (ThreadPosixImpl *)data;
int result = pthread_setspecific(_pt_ptr_index, self->_parent_obj);

View File

@ -156,7 +156,7 @@ DWORD ThreadWin32Impl::
root_func(LPVOID data) {
TAU_REGISTER_THREAD();
{
TAU_PROFILE("void ThreadWin32Impl::root_func()", " ", TAU_USER);
//TAU_PROFILE("void ThreadWin32Impl::root_func()", " ", TAU_USER);
ThreadWin32Impl *self = (ThreadWin32Impl *)data;
BOOL result = TlsSetValue(_pt_ptr_index, self->_parent_obj);

View File

@ -127,19 +127,15 @@ test_performance() {
MemoryUsage::freeze();
MapType *m = new MapType;
if (MemoryUsage::has_cpp_size()) {
cerr << "Empty map uses " << MemoryUsage::get_current_cpp_size()
<< " bytes.\n";
}
for (int p = 0; p < initial_population; p++) {
m->insert(MapType::value_type(samples[rand() & sample_mask], 0));
}
if (MemoryUsage::has_cpp_size()) {
cerr << "map with " << m->size()
<< " elements uses " << MemoryUsage::get_current_cpp_size()
<< " bytes.\n";
}
for (int r = 0; r < num_reps; r++) {
double now = clock->get_real_time();

View File

@ -13,8 +13,9 @@
////////////////////////////////////////////////////////////////////
#include "pandaFramework.h"
#include "geomQuad.h"
#include "textureAttrib.h"
#include "cardMaker.h"
#include "texture.h"
#include "pnmImage.h"
#include "cmath.h"
#include "mathNumbers.h"
@ -22,12 +23,10 @@ NodePath bogus_scene;
NodePath old_bogus_scene;
void
event_T(CPT_Event, void *data) {
event_T(const Event *, void *data) {
PandaFramework *framework = (PandaFramework *)data;
WindowFramework *wf = framework->get_window(0);
GraphicsStateGuardian *gsg = wf->get_graphics_window()->get_gsg();
Camera *camera = wf->get_camera(0);
NodePath models = framework->get_models();
NodePath render = wf->get_render();
@ -54,14 +53,9 @@ event_T(CPT_Event, void *data) {
cerr << "Loading " << num_quads_side * num_quads_side << " textures at "
<< tex_x_size << ", " << tex_y_size << "\n";
GeomNode *gnode = new GeomNode("quads");
bogus_scene.attach_new_node(gnode);
PNMImage white_center(tex_x_size / 4, tex_y_size / 4);
white_center.fill(1.0f, 1.0f, 1.0f);
PTA_Colorf colors;
colors.push_back(Colorf(1.0f, 1.0f, 1.0f, 1.0f));
for (int yi = 0; yi < num_quads_side; yi++) {
float y0 = (float)yi / (float)num_quads_side;
float y1 = (float)(yi + 1) / (float)num_quads_side;
@ -90,23 +84,13 @@ event_T(CPT_Event, void *data) {
tex->set_minfilter(Texture::FT_linear_mipmap_linear);
tex->load(bogus_image);
PTA_Vertexf coords;
PTA_TexCoordf uvs;
coords.push_back(Vertexf(hx0 * px0, hy0 * px0, py0));
coords.push_back(Vertexf(hx1 * px0, hy1 * px0, py0));
coords.push_back(Vertexf(hx1 * px1, hy1 * px1, py1));
coords.push_back(Vertexf(hx0 * px1, hy0 * px1, py1));
uvs.push_back(TexCoordf(0.0f, 0.0f));
uvs.push_back(TexCoordf(1.0f, 0.0f));
uvs.push_back(TexCoordf(1.0f, 1.0f));
uvs.push_back(TexCoordf(0.0f, 1.0f));
PT(GeomQuad) quad = new GeomQuad;
quad->set_coords(coords);
quad->set_colors(colors, G_OVERALL);
quad->set_num_prims(1);
quad->set_texcoords(uvs, G_PER_VERTEX);
gnode->add_geom(quad, RenderState::make(TextureAttrib::make(tex)));
CardMaker cm("card");
cm.set_frame(Vertexf(hx0 * px0, hy0 * px0, py0),
Vertexf(hx1 * px0, hy1 * px0, py0),
Vertexf(hx1 * px1, hy1 * px1, py1),
Vertexf(hx0 * px1, hy0 * px1, py1));
NodePath card = bogus_scene.attach_new_node(cm.generate());
card.set_texture(tex);
}
}
cerr << "Done.\n";
@ -134,7 +118,7 @@ main(int argc, char *argv[]) {
window->loop_animations();
framework.enable_default_keys();
framework.get_event_handler().add_hook("shift-t", event_T, &framework);
framework.define_key("shift-t", "test texture memory", event_T, &framework);
framework.main_loop();
}

View File

@ -44,7 +44,7 @@
textNode.cxx \
textProperties.cxx \
textPropertiesManager.cxx \
cmss12.bam.c cmss12.bam.pz.c persans.ttf.c
cmss12.bam_src.c cmss12.bam.pz_src.c persans.ttf_src.c
#define INSTALL_HEADERS \
config_text.h \

View File

@ -39,7 +39,7 @@
// If we have FreeType available, include the ttf font; it's superior
// because it's dynamic. See above.
#include "persans.ttf.c"
#include "persans.ttf_src.c"
#elif defined(HAVE_ZLIB)
@ -50,9 +50,9 @@
// egg2bam -rawtex -o cmss12.bam cmss12.egg
// pzip cmss12.bam
// bin2c -n default_font_data -o cmss12.bam.pz.c cmss12.bam.pz
// bin2c -n default_font_data -o cmss12.bam.pz_src.c cmss12.bam.pz
#include "cmss12.bam.pz.c"
#include "cmss12.bam.pz_src.c"
#else
@ -62,9 +62,9 @@
// Regenerate this file with (cmss12.egg can be loaded from the models tree):
// egg2bam -rawtex -o cmss12.bam cmss12.egg
// bin2c -n default_font_data -o cmss12.bam.c cmss12.bam
// bin2c -n default_font_data -o cmss12.bam_src.c cmss12.bam
#include "cmss12.bam.c"
#include "cmss12.bam_src.c"
#endif