-
Notifications
You must be signed in to change notification settings - Fork 374
Add agent trace support #1442
Add agent trace support #1442
Changes from all commits
e803a7f
97beb2b
ed248ce
87d9171
b309dc5
b573d9b
ed64240
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -222,8 +222,30 @@ path = "@SHIMPATH@" | |
#enable_tracing = true | ||
|
||
[agent.@PROJECT_TYPE@] | ||
# There is no field for this section. The goal is only to be able to | ||
# specify which type of agent the user wants to use. | ||
# If enabled, make the agent display debug-level messages. | ||
# (default: disabled) | ||
#enable_debug = true | ||
|
||
# Enable agent tracing. | ||
# | ||
# If enabled, the default trace mode is "dynamic" and the | ||
# default trace type is "isolated". The trace mode and type are set | ||
# explicity with the `trace_type=` and `trace_mode=` options. | ||
# | ||
# Notes: | ||
# | ||
# - Tracing is ONLY enabled when `enable_tracing` is set: explicitly | ||
# setting `trace_mode=` and/or `trace_type=` without setting `enable_tracing` | ||
# will NOT activate agent tracing. | ||
# | ||
# - See https://github.com/kata-containers/agent/blob/master/TRACING.md for | ||
# full details. | ||
# | ||
# (default: disabled) | ||
#enable_tracing = true | ||
# | ||
#trace_mode = "dynamic" | ||
#trace_type = "isolated" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are there option mutually exclusive? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
[netmon] | ||
# If enabled, the network monitoring process gets started when the | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// Copyright (c) 2017-2018 Intel Corporation | ||
// Copyright (c) 2017-2019 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
@@ -27,7 +27,7 @@ import ( | |
// | ||
// XXX: Increment for every change to the output format | ||
// (meaning any change to the EnvInfo type). | ||
const formatVersion = "1.0.21" | ||
const formatVersion = "1.0.23" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mathematics has changed since I left the school 😄 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Haha! Well, there are two bumps to this number in this PR :) |
||
|
||
// MetaInfo stores information on the format of the output itself | ||
type MetaInfo struct { | ||
|
@@ -112,7 +112,11 @@ type ShimInfo struct { | |
|
||
// AgentInfo stores agent details | ||
type AgentInfo struct { | ||
Type string | ||
Type string | ||
Debug bool | ||
Trace bool | ||
TraceMode string | ||
TraceType string | ||
} | ||
|
||
// DistroInfo stores host operating system distribution details. | ||
|
@@ -308,12 +312,26 @@ func getShimInfo(config oci.RuntimeConfig) (ShimInfo, error) { | |
return shim, nil | ||
} | ||
|
||
func getAgentInfo(config oci.RuntimeConfig) AgentInfo { | ||
func getAgentInfo(config oci.RuntimeConfig) (AgentInfo, error) { | ||
agent := AgentInfo{ | ||
Type: string(config.AgentType), | ||
} | ||
|
||
return agent | ||
switch config.AgentType { | ||
case vc.KataContainersAgent: | ||
agentConfig, ok := config.AgentConfig.(vc.KataAgentConfig) | ||
if !ok { | ||
return AgentInfo{}, errors.New("cannot determine Kata agent config") | ||
} | ||
agent.Debug = agentConfig.Debug | ||
agent.Trace = agentConfig.Trace | ||
agent.TraceMode = agentConfig.TraceMode | ||
agent.TraceType = agentConfig.TraceType | ||
default: | ||
// Nothing useful to report for the other agent types | ||
} | ||
|
||
return agent, nil | ||
} | ||
|
||
func getHypervisorInfo(config oci.RuntimeConfig) HypervisorInfo { | ||
|
@@ -361,7 +379,10 @@ func getEnvInfo(configFile string, config oci.RuntimeConfig) (env EnvInfo, err e | |
return EnvInfo{}, err | ||
} | ||
|
||
agent := getAgentInfo(config) | ||
agent, err := getAgentInfo(config) | ||
if err != nil { | ||
return EnvInfo{}, err | ||
} | ||
|
||
hypervisor := getHypervisorInfo(config) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it's time to have a specific section for tracing,
[trace]
might be...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good point. Yes, we could make a sub-section like the one below, but it might involve more rework as none of the other sections have sub-sections in them:
But we haven't done that historically. For example, we have two "groups" of options for the hypervisor section:
For consistency they would also need new subsections too.
I am tempted to suggest -- although not ideal I know -- that we keep the status quo for now and potentially totally rework the configuration handling in v2.