[prev in list] [next in list] [prev in thread] [next in thread] 

List:       monetdb-checkins
Subject:    MonetDB: sql_profiler - Change PROFILER EVENT comments to pseudo...
From:       Aris_Koning <commits+aris.koning=monetdbsolutions.com () monetdb ! o
Date:       2022-06-27 15:52:05
Message-ID: hg.4139059d8a15.1656345125.-5680374107954135603 () dev ! monetdb ! org
[Download RAW message or body]

Changeset: 4139059d8a15 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4139059d8a15
Modified Files:
	monetdb5/mal/mal_client.c
	sql/backends/monet5/sql.c
	sql/backends/monet5/sql_scenario.c
	sql/server/sql_mvc.c
	sql/storage/store.c
Branch: sql_profiler
Log Message:

Change PROFILER EVENT comments to pseudo function calls.


diffs (161 lines):

diff --git a/monetdb5/mal/mal_client.c b/monetdb5/mal/mal_client.c
--- a/monetdb5/mal/mal_client.c
+++ b/monetdb5/mal/mal_client.c
@@ -206,7 +206,7 @@ MCexitClient(Client c)
 		c->fdout = NULL;
 		c->fdin = NULL;
 	}
-	// TODO PROFILER EVENT: end of Client object, i.e. client exits and mapi connection \
is closed. +	// TODO PROFILER: EVENT("end of client connection", "client_id", \
TYPE_int, c->id)  }
 
 static Client
@@ -297,7 +297,7 @@ MCinitClient(oid user, bstream *fin, str
 
 	MT_lock_set(&mal_contextLock);
 	c = MCnewClient();
-	// TODO PROFILER EVENT: start of new Client object with id aka a new connection.
+	// TODO PROFILER: EVENT("start of client connection", "client_id", TYPE_int, c->id)
 
 	if (c)
 		c = MCinitClientRecord(c, user, fin, fout);
diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -128,9 +128,9 @@ sql_symbol2relation(backend *be, symbol 
 	int value_based_opt = be->mvc->emode != m_prepare, storage_based_opt;
 	int profile = be->mvc->emode == m_plan;
 
-	// TODO PROFILER EVENT: start of SQL compilation,i.e. parse tree to relation.: log \
be->client->curprg->def->tag +	// TODO PROFILER: EVENT("start of SQL compiler", \
"program_id", TYPE_int, log c->curprg->def->tag)  rel = rel_semantic(query, sym);
-	// TODO PROFILER EVENT: end of SQL compilation,i.e. parse tree to relation and \
start of relational optimizer: log be->client->curprg->def->tag +	// TODO PROFILER: \
EVENT("end of SQL compiler;start of relational optimizer","program_id", TYPE_int, \
be->c->curprg->def->tag, "error", TYPE_int, rel == NULL)  storage_based_opt = \
value_based_opt && rel && !is_ddl(rel->op);  Tbegin = GDKusec();
 	if (rel)
@@ -141,7 +141,7 @@ sql_symbol2relation(backend *be, symbol 
 		be->no_mitosis = 1;
 	be->reloptimizer = GDKusec() - Tbegin;
 
-	// TODO PROFILER EVENT: end of relational optimizer: log \
be->client->curprg->def->tag +	// TODO PROFILER: EVENT("start of relational \
optimizer","program_id": TYPE_int, be->c->curprg->def->tag, "error", TYPE_int, rel == \
NULL)  return rel;
 }
 
@@ -173,7 +173,7 @@ sqlcleanup(backend *be, int err)
 }
 
 /*
- * The internal administration of the SQL compilation and execution state
+ * The internal administration of the MAL compiler and execution state
  * is administered by a state descriptor accessible in each phase.
  * Failure to find the state descriptor aborts the session.
  */
diff --git a/sql/backends/monet5/sql_scenario.c b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -1109,7 +1109,7 @@ SQLparser(Client c)
 	tag = runtimeProfileSetTag(c);
 	assert(tag == c->curprg->def->tag);
 	(void) tag;
-	// TODO PROFILER EVENT: start of sql parsing is start of sql compilation: log \
c->curprg->def->tag +	// TODO PROFILER: EVENT("start of SQL parser", "client_id", \
TYPE_int, c->id, "program_id": TYPE_int, log c->curprg->def->tag)  
 	if ((err = sqlparse(m)) ||
 	    /* Only forget old errors on transaction boundaries */
@@ -1137,7 +1137,7 @@ SQLparser(Client c)
 	be->q = NULL;
 	c->query = query_cleaned(m->sa, QUERY(m->scanner));
 
-	// TODO PROFILER EVENT: end of sql parsing. Also add the cleaned query to the event
+	// TODO PROFILER: EVENT("end of SQL parser", "program_id": TYPE_int, log \
c->curprg->def->tag, "query": TYPE_str, c->query)  
 	if (c->query == NULL) {
 		err = 1;
@@ -1194,12 +1194,12 @@ SQLparser(Client c)
 				}
 			}
 
-			// TODO PROFILER EVENT: start of relation to MAL compilation: log \
c->curprg->def->tag +			// TODO PROFILER: EVENT("start of MAL compiler","program_id": \
TYPE_int, log c->curprg->def->tag, "query": TYPE_str, c->query)  if \
(backend_dumpstmt(be, c->curprg->def, r, !(m->emod & mod_exec), 0, c->query) < 0)  \
err = 1;  else
 				opt = (m->emod & mod_exec) == 0;//1;
-			// TODO PROFILER EVENT: end of relation to MAL compilation: log \
c->curprg->def->tag and err if present. +			// TODO PROFILER: EVENT("end of MAL \
compiler","program_id": TYPE_int, log c->curprg->def->tag, "query": TYPE_str, \
c->query, "error_code", TYPE_int, err)  } else {
 			char *q_copy = sa_strdup(m->sa, c->query);
 
@@ -1277,9 +1277,9 @@ SQLparser(Client c)
 
 		/* in case we had produced a non-cachable plan, the optimizer should be called */
 		if (msg == MAL_SUCCEED && opt ) {
-			// TODO PROFILER EVENT: start of MAL optimizer. log c->curprg->def->tag
+			// TODO PROFILER: EVENT("start of MAL optimizer","program_id": TYPE_int, log \
c->curprg->def->tag)  msg = SQLoptimizeQuery(c, c->curprg->def);
-			// TODO PROFILER EVENT: end  of MAL optimizer. log c->curprg->def->tag and error \
if so +			// TODO PROFILER: EVENT("end of MAL optimizer","program_id": TYPE_int, log \
c->curprg->def->tag, "error_msg", TYPE_str, msg)  
 			if (msg != MAL_SUCCEED) {
 				str other = c->curprg->def->errors;
diff --git a/sql/server/sql_mvc.c b/sql/server/sql_mvc.c
--- a/sql/server/sql_mvc.c
+++ b/sql/server/sql_mvc.c
@@ -473,7 +473,7 @@ mvc_trans(mvc *m)
 
 	TRC_INFO(SQL_TRANS, "Starting transaction\n");
 	res = sql_trans_begin(m->session);
-	// TODO PROFILER EVENT: start of transaction: log m->clientid, m->session->tr->tid \
and m->session->tr->ts +	// TODO PROFILER: EVENT("start of transaction","client_id": \
TYPE_int, m->clientid, "tid": TYPE_int, m->session->tr->tid, "ts": TYPE_int, \
m->session->tr->ts)  if (m->qc && (res || err)) {
 		int seqnr = m->qc->id;
 		if (m->qc)
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -3575,7 +3575,7 @@ sql_trans_rollback(sql_trans *tr, bool c
 {
 	sqlstore *store = tr->store;
 
-	// TODO PROFILER EVENT: start of rollback log tr->tid and ts
+	// TODO PROFILER: EVENT("start of rollback", "tid": TYPE_int, tr->tid)
 
 	/* move back deleted */
 	if (tr->localtmps.dset) {
@@ -3673,7 +3673,7 @@ sql_trans_rollback(sql_trans *tr, bool c
 		tr->depchanges = NULL;
 	}
 
-	// TODO PROFILER EVENT: end of rollback log tr->tid and ts
+	// TODO PROFILER: EVENT("end of rollback", "tid": TYPE_int, tr->tid)
 }
 
 sql_trans *
@@ -3907,7 +3907,7 @@ sql_trans_commit(sql_trans *tr)
 		}
 
 
-		// TODO PROFILER EVENT: start of commit log tid and ts
+		// TODO PROFILER: EVENT("start of commit","tid": TYPE_int, tr->tid)
 
 		/* log changes should only be done if there is something to log */
 		const bool log = !tr->parent && tr->logchanges > 0;
@@ -4039,7 +4039,7 @@ sql_trans_commit(sql_trans *tr)
 	if (ok == LOG_OK)
 		ok = clean_predicates_and_propagate_to_parent(tr);
 
-	// TODO PROFILER EVENT: end of commit log tid, ts and commit_ts (which is now the \
end timestamp) and ok, i.e. succes or error +	// TODO PROFILER: EVENT("end of \
commit","tid": TYPE_int, tr->tid, "ts", TYPE_int, tr->ts, "ok", TYPE_int, ok)  return \
(ok==LOG_OK)?SQL_OK:SQL_ERR;  }
 
@@ -7040,6 +7040,6 @@ sql_trans_end(sql_session *s, int ok)
 	store->oldest = oldest;
 	assert(list_length(store->active) == (int) ATOMIC_GET(&store->nr_active));
 	store_unlock(store);
-	// TODO PROFILER EVENT: end of transaction log s->tr->tid
+	// TODO PROFILER: EVENT("start of transaction","client_id": TYPE_int, m->clientid, \
"tid": TYPE_int, m->session->tr->tid, "ts": TYPE_int, m->session->tr->ts, "ok", \
TYPE_int: ok)  return ok;
 }
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-leave@monetdb.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic