Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
120b00fb
There was an error fetching the commit references. Please try again later.
Commit
120b00fb
authored
7 years ago
by
bunnei
Browse files
Options
Downloads
Patches
Plain Diff
telemetry: Log a few simple data fields throughout core.
parent
f3e14cae
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/core/loader/ncch.cpp
+3
-0
3 additions, 0 deletions
src/core/loader/ncch.cpp
src/core/telemetry_session.cpp
+18
-0
18 additions, 0 deletions
src/core/telemetry_session.cpp
src/core/telemetry_session.h
+1
-1
1 addition, 1 deletion
src/core/telemetry_session.h
with
22 additions
and
1 deletion
src/core/loader/ncch.cpp
+
3
−
0
View file @
120b00fb
...
...
@@ -9,6 +9,7 @@
#include
"common/logging/log.h"
#include
"common/string_util.h"
#include
"common/swap.h"
#include
"core/core.h"
#include
"core/file_sys/archive_selfncch.h"
#include
"core/hle/kernel/process.h"
#include
"core/hle/kernel/resource_limit.h"
...
...
@@ -339,6 +340,8 @@ ResultStatus AppLoader_NCCH::Load() {
LOG_INFO
(
Loader
,
"Program ID: %016"
PRIX64
,
ncch_header
.
program_id
);
Core
::
Telemetry
().
AddField
(
Telemetry
::
FieldType
::
Session
,
"ProgramId"
,
ncch_header
.
program_id
);
is_loaded
=
true
;
// Set state to loaded
result
=
LoadExec
();
// Load the executable into memory for booting
...
...
This diff is collapsed.
Click to expand it.
src/core/telemetry_session.cpp
+
18
−
0
View file @
120b00fb
...
...
@@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include
<cstring>
#include
"common/scm_rev.h"
#include
"core/telemetry_session.h"
...
...
@@ -10,9 +12,25 @@ namespace Core {
TelemetrySession
::
TelemetrySession
()
{
// TODO(bunnei): Replace with a backend that logs to our web service
backend
=
std
::
make_unique
<
Telemetry
::
NullVisitor
>
();
// Log one-time session start information
const
auto
duration
{
std
::
chrono
::
steady_clock
::
now
().
time_since_epoch
()};
const
auto
start_time
{
std
::
chrono
::
duration_cast
<
std
::
chrono
::
microseconds
>
(
duration
).
count
()};
AddField
(
Telemetry
::
FieldType
::
Session
,
"StartTime"
,
start_time
);
// Log one-time application information
const
bool
is_git_dirty
{
std
::
strstr
(
Common
::
g_scm_desc
,
"dirty"
)
!=
nullptr
};
AddField
(
Telemetry
::
FieldType
::
App
,
"GitIsDirty"
,
is_git_dirty
);
AddField
(
Telemetry
::
FieldType
::
App
,
"GitBranch"
,
Common
::
g_scm_branch
);
AddField
(
Telemetry
::
FieldType
::
App
,
"GitRevision"
,
Common
::
g_scm_rev
);
}
TelemetrySession
::~
TelemetrySession
()
{
// Log one-time session end information
const
auto
duration
{
std
::
chrono
::
steady_clock
::
now
().
time_since_epoch
()};
const
auto
end_time
{
std
::
chrono
::
duration_cast
<
std
::
chrono
::
microseconds
>
(
duration
).
count
()};
AddField
(
Telemetry
::
FieldType
::
Session
,
"EndTime"
,
end_time
);
// Complete the session, submitting to web service if necessary
// This is just a placeholder to wrap up the session once the core completes and this is
// destroyed. This will be moved elsewhere once we are actually doing real I/O with the service.
...
...
This diff is collapsed.
Click to expand it.
src/core/telemetry_session.h
+
1
−
1
View file @
120b00fb
...
...
@@ -31,7 +31,7 @@ public:
}
private
:
Telemetry
::
FieldCollection
field_collection
;
///<
Field collection, t
racks all added fields
Telemetry
::
FieldCollection
field_collection
;
///<
T
racks all added fields
for the session
std
::
unique_ptr
<
Telemetry
::
VisitorInterface
>
backend
;
///< Backend interface that logs fields
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment