code/Debug/Model/Db/Profiler.php
public function queryEnd($queryId)
    {
        $result = $this->parentQueryEnd($queryId);

        if ($this->captureStacktraces) {
            $this->stackTraces[$queryId] = $this->getStackTrace();
        }

        return $result;
    }
public function queryEnd($queryId)
    {
        $result = $this->parentQueryEnd($queryId);

        if ($this->captureStacktraces) {
            $this->stackTraces[$queryId] = $this->getStackTrace();
        }

        return $result;
    }
Calls parent implementation and saves stack trace

@param int $queryId
@return string