From d0af4158f2f8c5ac4ad1fd0efd62e676e1fbe753 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Fri, 20 Jan 2006 14:25:30 +0000 Subject: [PATCH] - trace context allocation/freeing (disabled at compile time by default) - push version --- org.glite.lb.common/project/version.properties | 2 +- org.glite.lb.common/src/context.c | 27 +++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/org.glite.lb.common/project/version.properties b/org.glite.lb.common/project/version.properties index 3cf83a2..df681cf 100644 --- a/org.glite.lb.common/project/version.properties +++ b/org.glite.lb.common/project/version.properties @@ -1,4 +1,4 @@ #Fri Sep 02 14:17:07 CEST 2005 -module.version=3.0.1 +module.version=3.0.2 module.build=2 module.age=1 diff --git a/org.glite.lb.common/src/context.c b/org.glite.lb.common/src/context.c index 7978a9e..c4a46d4 100644 --- a/org.glite.lb.common/src/context.c +++ b/org.glite.lb.common/src/context.c @@ -15,6 +15,10 @@ static void free_voms_groups(edg_wll_VomsGroups *); +/* uncomment to get the trace +#define CTXTRACE "/tmp/lb-context-trace" +*/ + int edg_wll_InitContext(edg_wll_Context *ctx) { int i; @@ -37,6 +41,18 @@ int edg_wll_InitContext(edg_wll_Context *ctx) out->connToUse = -1; *ctx = out; + +#ifdef CTXTRACE +{ + int trc = open(CTXTRACE,O_WRONLY|O_CREAT,0644); + char buf[200]; + sprintf(buf,"%p init\n",out); + lseek(trc,0,SEEK_END); + write(trc,buf,strlen(buf)); + close(trc); +} +#endif + return 0; } @@ -46,7 +62,16 @@ void edg_wll_FreeContext(edg_wll_Context ctx) OM_uint32 min_stat; if (!ctx) return; - +#ifdef CTXTRACE +{ + int trc = open(CTXTRACE,O_WRONLY|O_CREAT,0644); + char buf[200]; + sprintf(buf,"%p free\n",ctx); + lseek(trc,0,SEEK_END); + write(trc,buf,strlen(buf)); + close(trc); +} +#endif if (ctx->errDesc) free(ctx->errDesc); if (ctx->connPool) { int i; -- 1.8.2.3