aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/target/nds32.c6
-rw-r--r--src/target/target.c4
2 files changed, 6 insertions, 4 deletions
diff --git a/src/target/nds32.c b/src/target/nds32.c
index 487e19c..add66b2 100644
--- a/src/target/nds32.c
+++ b/src/target/nds32.c
@@ -2496,6 +2496,12 @@ int nds32_profiling(struct target *target, uint32_t *samples,
struct aice_port_s *aice = target_to_aice(target);
struct nds32 *nds32 = target_to_nds32(target);
+ /* REVISIT: can nds32 profile without halting? */
+ if (target->state != TARGET_HALTED) {
+ LOG_WARNING("target %s is not halted (profiling)", target->cmd_name);
+ return ERROR_TARGET_NOT_HALTED;
+ }
+
if (max_num_samples < iteration)
iteration = max_num_samples;
diff --git a/src/target/target.c b/src/target/target.c
index fa609ef..d1399ed 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -1324,10 +1324,6 @@ unsigned target_address_bits(struct target *target)
int target_profiling(struct target *target, uint32_t *samples,
uint32_t max_num_samples, uint32_t *num_samples, uint32_t seconds)
{
- if (target->state != TARGET_HALTED) {
- LOG_WARNING("target %s is not halted (profiling)", target->cmd_name);
- return ERROR_TARGET_NOT_HALTED;
- }
return target->type->profiling(target, samples, max_num_samples,
num_samples, seconds);
}