Native code license headers (#2225)
This commit is contained in:
parent
f8f991442b
commit
b6898c5ee6
|
|
@ -31,13 +31,20 @@ public class AssemblyRedirectionSourceGenerator
|
|||
|
||||
var sourceContents = GenerateSourceContents(assemblies);
|
||||
|
||||
File.WriteAllText(generatedFilePath, sourceContents, Encoding.UTF8);
|
||||
File.WriteAllText(generatedFilePath, sourceContents);
|
||||
Log.Information("Assembly redirection source generated {0}", generatedFilePath);
|
||||
}
|
||||
|
||||
static string GenerateSourceContents(SortedDictionary<string, AssemblyNameDefinition> assemblies)
|
||||
{
|
||||
var sb = new StringBuilder(assemblies.Count * 256);
|
||||
sb.AppendLine("""
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
""");
|
||||
sb.AppendLine();
|
||||
sb.AppendLine($"// Auto-generated file, do not change it - generated by the {nameof(AssemblyRedirectionSourceGenerator)} type");
|
||||
sb.Append(@"
|
||||
#include ""cor_profiler.h""
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
# Copyright The OpenTelemetry Authors
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cmake_minimum_required (VERSION 3.8..3.19)
|
||||
cmake_policy(SET CMP0015 NEW)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
// Auto-generated file, do not change it - generated by the IntegrationsJsonGenerator
|
||||
#ifndef BYTECODE_INSTRUMENTATIONS_H
|
||||
#define BYTECODE_INSTRUMENTATIONS_H
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "calltarget_tokens.h"
|
||||
|
||||
#include "cor_profiler.h"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_CALLTARGET_TOKENS_H_
|
||||
#define OTEL_CLR_PROFILER_CALLTARGET_TOKENS_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "clr_helpers.h"
|
||||
|
||||
#include <cstring>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_CLR_HELPERS_H_
|
||||
#define OTEL_CLR_PROFILER_CLR_HELPERS_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
#ifndef OTEL_CLR_PROFILER_COM_PTR_H_
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_COM_PTR_H_
|
||||
#define OTEL_CLR_PROFILER_COM_PTR_H_
|
||||
|
||||
#include <cassert>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "cor_profiler.h"
|
||||
|
||||
#include "corhlpr.h"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_COR_PROFILER_H_
|
||||
#define OTEL_CLR_PROFILER_COR_PROFILER_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
#include "cor_profiler_base.h"
|
||||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "cor_profiler_base.h"
|
||||
#include "logger.h"
|
||||
|
||||
namespace trace
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
#ifndef OTEL_CLR_PROFILER_COR_PROFILER_BASE_H_
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_COR_PROFILER_BASE_H_
|
||||
#define OTEL_CLR_PROFILER_COR_PROFILER_BASE_H_
|
||||
|
||||
#include <atomic>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_DLLMAIN_H_
|
||||
#define OTEL_CLR_PROFILER_DLLMAIN_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_ENVIRONMENT_VARIABLES_H_
|
||||
#define OTEL_CLR_PROFILER_ENVIRONMENT_VARIABLES_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_ENVIRONMENT_VARIABLES_PARSER_H_
|
||||
#define OTEL_CLR_PROFILER_ENVIRONMENT_VARIABLES_PARSER_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_ENVIRONMENT_VARIABLES_UTIL_H_
|
||||
#define OTEL_CLR_PROFILER_ENVIRONMENT_VARIABLES_UTIL_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "il_rewriter_wrapper.h"
|
||||
|
||||
ILRewriter* ILRewriterWrapper::GetILRewriter() const
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_IL_REWRITER_WRAPPER_H_
|
||||
#define OTEL_CLR_PROFILER_IL_REWRITER_WRAPPER_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "integration.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_INTEGRATION_H_
|
||||
#define OTEL_CLR_PROFILER_INTEGRATION_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "integration_loader.h"
|
||||
|
||||
#include <exception>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_INTEGRATION_LOADER_H_
|
||||
#define OTEL_CLR_PROFILER_INTEGRATION_LOADER_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
//---------------------------------------------------------------------------------------
|
||||
// Exports that managed code from OpenTelemetry.AutoInstrumentation.dll will
|
||||
// P/Invoke into
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "environment_variables.h"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_LOGGER_IMPL_H_
|
||||
#define OTEL_CLR_PROFILER_LOGGER_IMPL_H_
|
||||
#include "util.h"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "logging.h"
|
||||
|
||||
#include "pal.h"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_LOGGING_H_
|
||||
#define OTEL_CLR_PROFILER_LOGGING_H_
|
||||
#include "util.h"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_MACROS_H_
|
||||
#define OTEL_CLR_PROFILER_MACROS_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
#include <fstream>
|
||||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
#include "clr_helpers.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
#pragma once
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <corhlpr.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
static const uint32_t xref[] = {
|
||||
0, 59, 60, 61, 62, 65, 66, 67, 68, 69, 70, 71, 72, 73,
|
||||
74, 75, 76, 77, 78, 79, 80, 82, 83, 84, 85, 86, 87, 88,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
#ifndef OTEL_CLR_PROFILER_MODULE_METADATA_H_
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_MODULE_METADATA_H_
|
||||
#define OTEL_CLR_PROFILER_MODULE_METADATA_H_
|
||||
|
||||
#include <corhlpr.h>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
// Auto-generated file, do not change it - generated by the AssemblyRedirectionSourceGenerator type
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
// Auto-generated file, do not change it - generated by the AssemblyRedirectionSourceGenerator type
|
||||
|
||||
#include "cor_profiler.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_PROFILER_CONSTANTS_H
|
||||
#define OTEL_PROFILER_CONSTANTS_H
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_PAL_H_
|
||||
#define OTEL_CLR_PROFILER_PAL_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "rejit_handler.h"
|
||||
|
||||
#include "logger.h"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_REJIT_HANDLER_H_
|
||||
#define OTEL_CLR_PROFILER_REJIT_HANDLER_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by Resource.rc
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_STARTUP_HOOK_H_
|
||||
#define OTEL_CLR_PROFILER_STARTUP_HOOK_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_STATS_H_
|
||||
#define OTEL_CLR_PROFILER_STATS_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "string.h"
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_STRING_H_
|
||||
#define OTEL_CLR_PROFILER_STRING_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "util.h" // Keep first to avoid PCH warning.
|
||||
|
||||
#include <cwctype>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef OTEL_CLR_PROFILER_UTIL_H_
|
||||
#define OTEL_CLR_PROFILER_UTIL_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
constexpr auto PROFILER_VERSION = "0.6.0-beta.2";
|
||||
|
|
|
|||
|
|
@ -179,6 +179,13 @@ void UpdateNativeInstrumentationFile(string filePath, Dictionary<string, List<st
|
|||
using var fileStream = new FileStream(filePath, FileMode.Truncate);
|
||||
|
||||
using var writer = new StreamWriter(fileStream);
|
||||
writer.WriteLine("""
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
""");
|
||||
writer.WriteLine();
|
||||
writer.WriteLine($"// Auto-generated file, do not change it - generated by the {nameof(IntegrationsJsonGenerator)}");
|
||||
writer.WriteLine("#ifndef BYTECODE_INSTRUMENTATIONS_H");
|
||||
writer.WriteLine("#define BYTECODE_INSTRUMENTATIONS_H");
|
||||
|
|
|
|||
Loading…
Reference in New Issue