Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
# AGENTS Instructions
- Do not ever use non-ascii characters for source code or comments (permissible inside of strings if absolutely necessary but avoid if possible)
- Do not attempt a build unless explicitly instructed.
- Do not run tests unless explicitly instructed.
- Do not ever modify files in .git subfolders.
- After finishing all changes, run a conversion pass over every changed/created text file to enforce CRLF and eliminate any stray LF.
- Do not run CRLF normalization on any non-text or binary files (for example: .png, .jpg, .gif, .mp3, .wav, .fbx, .unity). Limit normalization to plain text source/config files only.
- Use this PowerShell script directly in the current shell to normalize line endings (preserves file encoding). Do not wrap it in a nested powershell -Command invocation, because nested PowerShell quoting can corrupt variable and string parsing:
- $paths = git status --porcelain | ForEach-Object { $_.Substring(3) }; foreach ($p in $paths) { if (Test-Path $p) { $bytes = [System.IO.File]::ReadAllBytes($p); $hadBom = $bytes.Length -ge 3 -and $bytes[0] -eq 0xEF -and $bytes[1] -eq 0xBB -and $bytes[2] -eq 0xBF; $sr = New-Object System.IO.StreamReader($p, $true); $text = $sr.ReadToEnd(); $enc = $sr.CurrentEncoding; $sr.Close(); if ($enc.WebName -eq "utf-8") { $enc = New-Object System.Text.UTF8Encoding($hadBom) }; $text = $text -replace "`r?`n", "`r`n"; $sw = New-Object System.IO.StreamWriter($p, $false, $enc); $sw.NewLine = "`r`n"; $sw.Write($text); $sw.Close(); } }
- After finishing all changes, use `$normalize-crlf` to normalize changed/created text files; do not run ad hoc line-ending scripts directly.
- If unexpected new files appear, ignore them and continue without asking for instruction.
- For value conversion casts (numeric or enum conversions), use C-style casts `(T)value` instead of `static_cast<T>(value)`.
- For const, pointer, reference, up/down, or reinterpret casts, use C++ cast syntax (`const_cast`, `dynamic_cast`, `reinterpret_cast`, etc.).
- Do not bind unused names in structured bindings. Prefer binding only needed values (for example use `.first` from `emplace()` or iterate entries without destructuring unused keys).
- Do not fully qualify namespaces when not needed by local scope (for example prefer `MetricUse` or `svc::MetricUse` over `pmon::svc::MetricUse` when already inside `pmon::svc::acts` or with suitable using scope).
- Do not fully qualify namespaces when not needed by local scope (for example prefer `MetricUse` or `svc::MetricUse` over `pmon::svc::MetricUse` when already inside `pmon::svc::acts` or with suitable using scope).
7 changes: 4 additions & 3 deletions IntelPresentMon/AppCef/CefNano.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<ClInclude Include="source\util\AsyncEndpointCollection.h" />
<ClInclude Include="source\util\AsyncEndpointManager.h" />
<ClInclude Include="source\util\async\CheckPathExistence.h" />
<ClInclude Include="source\util\async\GetAppInfo.h" />
<ClInclude Include="source\util\async\GetTopGpuProcess.h" />
<ClInclude Include="source\util\async\LoadEnvVars.h" />
<ClInclude Include="source\util\async\LoadFile.h" />
Expand Down Expand Up @@ -159,7 +160,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>PM_VER_FILE_STR=&quot;$(PresentMonFileVersion)&quot;;PM_VER_PRODUCT_STR=&quot;$(PresentMonProductVersion)&quot;;PM_BUILD_WINSDK_VERSION_STR=&quot;$(WindowsTargetPlatformVersion)&quot;;PM_BUILD_CRT_RUNTIME_STR=&quot;MultiThreadedDebug&quot;;_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<FloatingPointModel>Fast</FloatingPointModel>
<LanguageStandard>stdcpplatest</LanguageStandard>
Expand Down Expand Up @@ -187,7 +188,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>PM_VER_FILE_STR=&quot;$(PresentMonFileVersion)&quot;;PM_VER_PRODUCT_STR=&quot;$(PresentMonProductVersion)&quot;;PM_BUILD_WINSDK_VERSION_STR=&quot;$(WindowsTargetPlatformVersion)&quot;;PM_BUILD_CRT_RUNTIME_STR=&quot;MultiThreaded&quot;;NDEBUG;_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<FloatingPointModel>Fast</FloatingPointModel>
<LanguageStandard>stdcpplatest</LanguageStandard>
Expand Down Expand Up @@ -215,4 +216,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
5 changes: 4 additions & 1 deletion IntelPresentMon/AppCef/ipm-ui-vue/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function cyclePreset() {
// === Computed ===
const inSettings = computed(() => {
const routeName = typeof route.name === 'symbol' ? route.name.toString() : route.name;
return ['capture-config', 'overlay-config', 'data-config', 'other-config', 'flash-config', 'logging-config']
return ['capture-config', 'overlay-config', 'data-config', 'other-config', 'flash-config', 'logging-config', 'about-config']
.includes(routeName ?? '')
});
const targetName = computed(() => {
Expand Down Expand Up @@ -182,6 +182,9 @@ watch(() => loadout.widgets, async () => {
<v-list-item color="primary" :to="{ name: 'other-config' }">
<v-list-item-title class="nav-item">Other</v-list-item-title>
</v-list-item>
<v-list-item color="primary" :to="{ name: 'about-config' }">
<v-list-item-title class="nav-item">About</v-list-item-title>
</v-list-item>
</v-list>
</v-navigation-drawer>

Expand Down
4 changes: 4 additions & 0 deletions IntelPresentMon/AppCef/ipm-ui-vue/src/core/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { type Adapter } from './adapter'
import { type Spec } from '@/core/spec'
import { type Binding, type KeyOption, type ModifierOption, Action } from '@/core/hotkey'
import { type EnvVars } from './env-vars'
import { type AppInfo } from './app-info'
import { delayFor } from './timing'

export enum FileLocation {
Expand Down Expand Up @@ -54,6 +55,9 @@ export class Api {
static async loadEnvVars(): Promise<EnvVars> {
return await this.invokeEndpointFuture('loadEnvVars', {});
}
static async getAppInfo(): Promise<AppInfo> {
return await this.invokeEndpointFuture('getAppInfo', {});
}
static async introspect(): Promise<{metrics: Metric[], stats: Stat[], units: Unit[], adapters: Adapter[], systemDeviceId: number, defaultAdapterId: number}> {
const introData = await this.invokeEndpointFuture('Introspect', {});
if (!Array.isArray(introData.metrics) || !Array.isArray(introData.stats) ||
Expand Down
41 changes: 41 additions & 0 deletions IntelPresentMon/AppCef/ipm-ui-vue/src/core/app-info.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright (C) 2022 Intel Corporation
// SPDX-License-Identifier: MIT

export interface AppInfo {
productName: string;
productVersion: string;
fileVersion: string;
apiVersion: string;
middlewareApiVersion: string;
buildId: string;
buildHash: string;
buildHashShort: string;
buildDateTime: string;
buildConfig: string;
buildDirty: boolean;
isDebugBuild: boolean;
compileDate: string;
compileTime: string;
serviceBuildId: string;
serviceBuildTime: string;
serviceVersion: string;
cefVersion: string;
cefVersionMajor: number;
cefVersionMinor: number;
cefVersionPatch: number;
chromeVersion: string;
chromeVersionMajor: number;
chromeVersionMinor: number;
chromeVersionBuild: number;
chromeVersionPatch: number;
cefProcessType: string;
msvcVersion: string;
winSdkVersion: string;
crtVersion: string;
crtRuntime: string;
logLevel: string;
verboseModules: string;
devModeEnabled: boolean;
debugBlocklistEnabled: boolean;
chromiumDebugEnabled: boolean;
}
6 changes: 6 additions & 0 deletions IntelPresentMon/AppCef/ipm-ui-vue/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import CaptureConfigView from '@/views/CaptureConfigView.vue'
import FlashConfigView from '@/views/FlashConfigView.vue'
import OtherConfigView from '@/views/OtherConfigView.vue'
import LoggingConfigView from '@/views/LoggingConfigView.vue'
import AboutConfigView from '@/views/AboutConfigView.vue'

const router = createRouter({
history: createMemoryHistory(),
Expand Down Expand Up @@ -64,6 +65,11 @@ const router = createRouter({
name: 'other-config',
component: OtherConfigView,
},
{
path: '/about',
name: 'about-config',
component: AboutConfigView,
},
{
path: '/flash',
name: 'flash-config',
Expand Down
179 changes: 179 additions & 0 deletions IntelPresentMon/AppCef/ipm-ui-vue/src/views/AboutConfigView.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
<!-- Copyright (C) 2022 Intel Corporation -->
<!-- SPDX-License-Identifier: MIT -->

<script setup lang="ts">
import { computed, onMounted, ref } from 'vue';
import { Api } from '@/core/api';
import { signature as preferencesSignature } from '@/core/preferences';
import { signature as loadoutSignature } from '@/core/loadout';
import { type AppInfo } from '@/core/app-info';

interface InfoRow {
label: string;
value: string;
}

defineOptions({ name: 'AboutConfigView' });

const appInfo = ref<AppInfo|null>(null);
const errorMessage = ref('');

function boolText(value: boolean): string {
return value ? 'Yes' : 'No';
}

const applicationRows = computed<InfoRow[]>(() => {
if (appInfo.value === null) {
return [];
}
return [
{ label: 'Product', value: appInfo.value.productName },
{ label: 'Product Version', value: appInfo.value.productVersion },
{ label: 'API Version', value: appInfo.value.apiVersion },
{ label: 'Middleware API Version', value: appInfo.value.middlewareApiVersion },
{ label: 'Preferences Format', value: preferencesSignature.version },
{ label: 'Loadout Format', value: loadoutSignature.version },
{ label: 'UI Dev Mode', value: boolText(appInfo.value.devModeEnabled) },
{ label: 'Chromium Debugging', value: boolText(appInfo.value.chromiumDebugEnabled) },
{ label: 'Debug Blocklist', value: boolText(appInfo.value.debugBlocklistEnabled) },
{ label: 'Log Level', value: appInfo.value.logLevel },
{ label: 'Verbose Modules', value: appInfo.value.verboseModules },
];
});

const buildRows = computed<InfoRow[]>(() => {
if (appInfo.value === null) {
return [];
}
return [
{ label: 'Git Hash', value: appInfo.value.buildHash },
{ label: 'Short Hash', value: appInfo.value.buildHashShort },
{ label: 'Build Date/Time', value: appInfo.value.buildDateTime },
{ label: 'Build Config', value: appInfo.value.buildConfig },
{ label: 'Dirty Build', value: boolText(appInfo.value.buildDirty) },
];
});

const serviceRows = computed<InfoRow[]>(() => {
if (appInfo.value === null) {
return [];
}
return [
{ label: 'Service Build ID', value: appInfo.value.serviceBuildId },
{ label: 'Service Build Time', value: appInfo.value.serviceBuildTime },
{ label: 'Service Version', value: appInfo.value.serviceVersion },
];
});

const runtimeRows = computed<InfoRow[]>(() => {
if (appInfo.value === null) {
return [];
}
return [
{ label: 'CEF Version', value: appInfo.value.cefVersion },
{ label: 'MSVC Version', value: appInfo.value.msvcVersion },
{ label: 'Windows SDK', value: appInfo.value.winSdkVersion },
{ label: 'CRT Version', value: appInfo.value.crtVersion },
{ label: 'CRT Runtime', value: appInfo.value.crtRuntime },
];
});

onMounted(async () => {
try {
appInfo.value = await Api.getAppInfo();
}
catch (e) {
errorMessage.value = e instanceof Error ? e.message : String(e);
}
});
</script>

<template>
<div class="page-wrap">
<h2 class="mt-5 ml-5 header-top">
About
</h2>

<v-card class="page-card">
<v-progress-linear v-if="appInfo === null && errorMessage === ''" indeterminate color="primary" class="mt-4"></v-progress-linear>

<v-alert v-if="errorMessage !== ''" type="error" variant="tonal" class="mt-5">
{{ errorMessage }}
</v-alert>

<template v-if="appInfo !== null">
<v-card-title class="section-title">Application</v-card-title>
<v-table density="compact" class="info-table">
<tbody>
<tr v-for="row in applicationRows" :key="row.label">
<td class="info-label">{{ row.label }}</td>
<td class="info-value">{{ row.value }}</td>
</tr>
</tbody>
</v-table>

<v-card-title class="section-title">Build</v-card-title>
<v-table density="compact" class="info-table">
<tbody>
<tr v-for="row in buildRows" :key="row.label">
<td class="info-label">{{ row.label }}</td>
<td class="info-value">{{ row.value }}</td>
</tr>
</tbody>
</v-table>

<v-card-title class="section-title">Service</v-card-title>
<v-table density="compact" class="info-table">
<tbody>
<tr v-for="row in serviceRows" :key="row.label">
<td class="info-label">{{ row.label }}</td>
<td class="info-value">{{ row.value }}</td>
</tr>
</tbody>
</v-table>

<v-card-title class="section-title">Runtime</v-card-title>
<v-table density="compact" class="info-table">
<tbody>
<tr v-for="row in runtimeRows" :key="row.label">
<td class="info-label">{{ row.label }}</td>
<td class="info-value">{{ row.value }}</td>
</tr>
</tbody>
</v-table>
</template>
</v-card>
</div>
</template>

<style scoped>
.header-top {
color: white;
user-select: none;
}
.page-card {
margin: 15px 0;
padding: 0 15px 15px;
}
.page-wrap {
max-width: 750px;
flex-grow: 1;
}
.section-title {
color: rgba(255, 255, 255, 0.7);
font-size: 16px;
padding: 18px 0 6px;
}
.info-table {
background: transparent;
}
.info-label {
width: 210px;
color: rgba(255, 255, 255, 0.7);
white-space: nowrap;
}
.info-value {
overflow-wrap: anywhere;
user-select: text;
}
</style>
7 changes: 6 additions & 1 deletion IntelPresentMon/AppCef/source/DataBindAccessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,14 @@ namespace p2c::client::cef
}
}

const util::KernelWrapper* DataBindAccessor::GetKernelWrapper() const
{
return pKernelWrapper;
}
Comment thread
planetchili marked this conversation as resolved.

void DataBindAccessor::ClearKernelWrapper()
{
std::lock_guard lk{ kernelMtx };
pKernelWrapper = nullptr;
}
}
}
3 changes: 2 additions & 1 deletion IntelPresentMon/AppCef/source/DataBindAccessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace p2c::client::cef
CefRefPtr<CefV8Value>& retval,
CefString& exception) override;
void ResolveAsyncEndpoint(uint64_t uid, bool success, CefRefPtr<CefValue> pArgs);
const util::KernelWrapper* GetKernelWrapper() const;
Comment thread
planetchili marked this conversation as resolved.
void ClearKernelWrapper();
private:
// data
Expand All @@ -29,4 +30,4 @@ namespace p2c::client::cef
IMPLEMENT_REFCOUNTING(DataBindAccessor);
friend class DBAKernelHandler;
};
}
}
26 changes: 25 additions & 1 deletion IntelPresentMon/AppCef/source/util/ActionClientServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,30 @@ namespace p2c::client::util
SymmetricActionClient{ std::move(pipeName), std::move(context) }
{
auto res = DispatchSync(kproc::kact::OpenSession::Params{ GetCurrentProcessId() });
serviceBuildId_ = std::move(res.serviceBuildId);
serviceBuildTime_ = std::move(res.serviceBuildTime);
serviceVersion_ = std::move(res.serviceVersion);
middlewareApiVersion_ = std::move(res.middlewareApiVersion);
EstablishSession_(res.kernelPid);
}
}

const std::string& CefClient::GetServiceBuildId() const
{
return serviceBuildId_;
}

const std::string& CefClient::GetServiceBuildTime() const
{
return serviceBuildTime_;
}

const std::string& CefClient::GetServiceVersion() const
{
return serviceVersion_;
}

const std::string& CefClient::GetMiddlewareApiVersion() const
{
return middlewareApiVersion_;
}
}
Loading