acelyc111 commented on a change in pull request #3572: URL: https://github.com/apache/incubator-doris/pull/3572#discussion_r425211374
########## File path: be/src/util/trace.h ########## @@ -0,0 +1,291 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +#pragma once + +#include <iosfwd> +#include <memory> +#include <string> +#include <utility> +#include <vector> + +#include <rapidjson/writer.h> + +#include "gutil/macros.h" +#include "gutil/strings/stringpiece.h" +#include "gutil/strings/substitute.h" +#include "gutil/ref_counted.h" +#include "gutil/threading/thread_collision_warner.h" +#include "gutil/walltime.h" +#include "util/spinlock.h" +#include "util/trace_metrics.h" + +namespace doris { +class Trace; +} + +// Adopt a Trace on the current thread for the duration of the current +// scope. The old current Trace is restored when the scope is exited. +// +// 't' should be a Trace* pointer. +#define ADOPT_TRACE(t) doris::ScopedAdoptTrace _adopt_trace(t); + +// Issue a trace message, if tracing is enabled in the current thread. +// See Trace::SubstituteAndTrace for arguments. +// Example: +// TRACE("Acquired timestamp $0", timestamp); +#define TRACE(format, substitutions...) \ Review comment: I've update indentation in logconfig.cpp. But in my opinion, it would be better to leave the other independent files as they are, to avoid much difference with orginal source code, at most do some necessary modifications(e.g. use doris::SpinLock instead of kudu::simple_spinlock which hasn't been imported). Because if some day in the future we want to synchronize with the source code, and the source code has been updated (either bugfix or improvement), it would be easier for us to update the code in Doris. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org