--- /dev/null
+ASM_DIRS := Tizen.Tracer
+ASM_DLLS := $(addsuffix .dll,$(ASM_DIRS))
+
+FLAGS := /unsafe
+
+ALL: $(ASM_DLLS)
+
+define make-dll
+$(eval ASM = $(strip $1))
+$(eval SRC = $(shell find $(ASM) -path $(ASM)/obj -prune -o -name '*.cs' -print))
+$(eval PKG = $(shell echo $2 | tr ' ' ','))
+$(ASM).dll: $(SRC)
+ @echo "[BUILD] $$@"
+ @mcs /nologo /out:$$@ /t:library /keyfile:$(ASM)/$(ASM).snk $(addprefix /pkg:,$(PKG)) $(FLAGS) $(SRC)
+ @echo "[CHECK] $$@"
+ @RET=`mono-shlib-cop $$@`; \
+ CNT=`echo $$$$RET | grep -e '^error:' | wc -l`; \
+ if [ $$$$CNT -gt 0 ]; then echo $$$$RET; rm -f $$@ exit 1; fi
+endef
+
+$(eval $(call make-dll, Tizen.Trace, csapi-tizen))
+
+clean:
+ @rm -f $(ASM_DLLS)
--- /dev/null
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tizen.Tracer", "Tizen.Tracer\Tizen.Tracer.csproj", "{20C210FC-AE4F-411F-9BA9-8DD900ED61DB}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {20C210FC-AE4F-411F-9BA9-8DD900ED61DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {20C210FC-AE4F-411F-9BA9-8DD900ED61DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {20C210FC-AE4F-411F-9BA9-8DD900ED61DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {20C210FC-AE4F-411F-9BA9-8DD900ED61DB}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ StartupItem = Tizen.Tracer\Tizen.Tracer.csproj
+ EndGlobalSection
+EndGlobal
--- /dev/null
+<Properties>
+ <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
+ <MonoDevelop.Ide.Workbench ActiveDocument="Tizen.Tracer/Tizen/Tracer.cs">
+ <Files>
+ <File FileName="Tizen.Tracer/Tizen/Tracer.cs" Line="16" Column="3" />
+ <File FileName="Tizen.Tracer/Interop/Interop.Tracer.cs" Line="1" Column="1" />
+ </Files>
+ </MonoDevelop.Ide.Workbench>
+ <MonoDevelop.Ide.DebuggingService.Breakpoints>
+ <BreakpointStore />
+ </MonoDevelop.Ide.DebuggingService.Breakpoints>
+ <MonoDevelop.Ide.DebuggingService.PinnedWatches />
+</Properties>
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
--- /dev/null
+Name: csapi-trace
+Description: Tizen Trace API for C#
+Version: @version@
+Libs: -r:@dllpath@/@dllname@
+Requires:
--- /dev/null
+%define dllpath %{_libdir}/mono/tizen
+%define dllname Tizen.Tracer.dll
+
+Name: csapi-trace
+Summary: Tizen Tracer API for C#
+Version: 1.0.0
+Release: 1
+Group: Development/Libraries
+License: Apache-2.0
+URL: https://www.tizen.org
+Source0: %{name}-%{version}.tar.gz
+Source1: %{name}.manifest
+Source2: %{name}.pc.in
+
+# TODO: replace mono-compiler, mono-devel to mcs, mono-shlib-cop
+BuildRequires: mono-compiler
+BuildRequires: mono-devel
+# TODO: replace mono-core to gacutil.
+# mono-core should provide the symbol 'gacutil'
+Requires(post): mono-core
+Requires(postun): mono-core
+
+# P/Invoke Dependencies
+BuildRequires: pkgconfig(ttrace)
+BuildRequires: pkgconfig(capi-ttrace)
+
+# P/Invoke Runtime Dependencies
+# TODO: It should be removed after fix tizen-rpm-config
+Requires: ttrace
+Requires: capi-ttrace
+# DLL Dependencies
+BuildRequires: pkgconfig(csapi-tizen)
+#BuildRequires: ...
+
+%description
+Tizen Tracer API for C#
+
+%package devel
+Summary: Development package for %{name}
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Development package for %{name}
+
+%prep
+%setup -q
+
+cp %{SOURCE1} .
+
+%build
+# build dll
+make
+
+# check p/invoke
+if [ -x %{dllname} ]; then
+ RET=`mono-shlib-cop %{dllname}`; \
+ CNT=`echo $RET | grep -E "^error:" | wc -l`; \
+ if [ $CNT -gt 0 ]; then exit 1; fi
+fi
+
+%install
+# copy dll
+mkdir -p %{buildroot}%{dllpath}
+install -p -m 644 %{dllname} %{buildroot}%{dllpath}
+
+# generate pkgconfig
+mkdir -p %{buildroot}%{_libdir}/pkgconfig
+sed -e "s#@version@#%{version}#g" \
+ -e "s#@dllpath@#%{dllpath}#g" \
+ -e "s#@dllname@#%{dllname}#g" \
+ %{SOURCE2} > %{buildroot}%{_libdir}/pkgconfig/%{name}.pc
+
+%post
+gacutil -i %{dllpath}/%{dllname}
+
+%files
+%{dllpath}/%{dllname}
+
+%files devel
+%{_libdir}/pkgconfig/%{name}.pc
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+internal static partial class Interop
+{
+ internal static partial class Libraries
+ {
+ public const string ttrace = "libttrace.so.1";
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Tracer
+ {
+ [DllImport(Libraries.ttrace, EntryPoint = "trace_begin")]
+ internal static extern int Begin (String name);
+
+ [DllImport(Libraries.ttrace, EntryPoint = "trace_end")]
+ internal static extern int End ();
+
+ [DllImport(Libraries.ttrace, EntryPoint = "trace_async_begin")]
+ internal static extern int AsyncBegin (int cookie, String name);
+
+ [DllImport(Libraries.ttrace, EntryPoint = "trace_async_end")]
+ internal static extern int AsyncEnd (int cookie, String name);
+
+ [DllImport(Libraries.ttrace, EntryPoint = "trace_update_counter")]
+ internal static extern int TraceValue (int value, String name);
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Tizen.Tracer")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Samsung Electronics")]
+[assembly: AssemblyProduct("Tizen.Tracer")]
+[assembly: AssemblyCopyright("Copyright (c) 2016 Samsung Electronics Co., Ltd")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("3577eae8-b409-4bae-a5da-c6340be1dbc2")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>10.0.0</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{20C210FC-AE4F-411F-9BA9-8DD900ED61DB}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <RootNamespace>Tizen.Tracer</RootNamespace>
+ <AssemblyName>Tizen.Tracer</AssemblyName>
+ <SignAssembly>true</SignAssembly>
+ <AssemblyOriginatorKeyFile>Tizen.Tracer.snk</AssemblyOriginatorKeyFile>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <TargetFrameworkProfile />
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug</OutputPath>
+ <DefineConstants>DEBUG;</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>false</ConsolePause>
+ <Prefer32Bit>false</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>full</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>false</ConsolePause>
+ <Prefer32Bit>false</Prefer32Bit>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Interop\Interop.Libraries.cs" />
+ <Compile Include="Tizen\Tracer.cs" />
+ <Compile Include="Interop\Interop.Tracer.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <ItemGroup>
+ <None Include="Tizen.Tracer.snk" />
+ </ItemGroup>
+</Project>
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+
+namespace Tizen
+{
+ public static class Tracer
+ {
+ public static void Begin (String name)
+ {
+ Interop.Tracer.Begin (name);
+ }
+
+ public static void End ()
+ {
+ Interop.Tracer.End ();
+ }
+
+ public static void AsyncBegin (int cookie, String name)
+ {
+ Interop.Tracer.AsyncBegin (cookie, name);
+ }
+
+ public static void AsyncEnd (int cookie, String name)
+ {
+ Interop.Tracer.AsyncEnd (cookie, name);
+ }
+
+ public static void TraceValue (int value, String name)
+ {
+ Interop.Tracer.TraceValue (value, name);
+ }
+ }
+}
+