[gem5-dev] Change in gem5/gem5[develop]: sim: Align coding style of probes
Daniel Carvalho has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/38697 ) Change subject: sim: Align coding style of probes .. sim: Align coding style of probes Fix coding style of probes for the following aspects: - Long lines - Return type of multi-line functions - Name of local parameters Also, added missing overrides Jira: https://gem5.atlassian.net/browse/GEM5-857 Change-Id: Ibd905d1941fc203ca8308f7a3930d58515b19a97 Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38697 Tested-by: kokoro Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg --- M src/sim/probe/probe.cc M src/sim/probe/probe.hh 2 files changed, 49 insertions(+), 31 deletions(-) Approvals: Andreas Sandberg: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/sim/probe/probe.cc b/src/sim/probe/probe.cc index 3101f76..da3ca64 100644 --- a/src/sim/probe/probe.cc +++ b/src/sim/probe/probe.cc @@ -11,6 +11,9 @@ * unmodified and in its entirety in all distributions of the software, * modified or unmodified, in source code or in binary form. * + * Copyright (c) 2020 Inria + * All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: redistributions of source code must retain the above copyright @@ -78,35 +81,39 @@ } bool -ProbeManager::addListener(std::string pointName, ProbeListener ) +ProbeManager::addListener(std::string point_name, ProbeListener ) { -DPRINTFR(ProbeVerbose, "Probes: Call to addListener to \"%s\" on %s.\n", pointName, object->name()); +DPRINTFR(ProbeVerbose, "Probes: Call to addListener to \"%s\" on %s.\n", +point_name, object->name()); bool added = false; for (auto p = points.begin(); p != points.end(); ++p) { -if ((*p)->getName() == pointName) { +if ((*p)->getName() == point_name) { (*p)->addListener(); added = true; } } if (!added) { -DPRINTFR(ProbeVerbose, "Probes: Call to addListener to \"%s\" on %s failed, no such point.\n", pointName, object->name()); +DPRINTFR(ProbeVerbose, "Probes: Call to addListener to \"%s\" on " +"%s failed, no such point.\n", point_name, object->name()); } return added; } bool -ProbeManager::removeListener(std::string pointName, ProbeListener ) +ProbeManager::removeListener(std::string point_name, ProbeListener ) { -DPRINTFR(ProbeVerbose, "Probes: Call to removeListener from \"%s\" on %s.\n", pointName, object->name()); +DPRINTFR(ProbeVerbose, "Probes: Call to removeListener from \"%s\" on " +"%s.\n", point_name, object->name()); bool removed = false; for (auto p = points.begin(); p != points.end(); ++p) { -if ((*p)->getName() == pointName) { +if ((*p)->getName() == point_name) { (*p)->removeListener(); removed = true; } } if (!removed) { -DPRINTFR(ProbeVerbose, "Probes: Call to removeListener from \"%s\" on %s failed, no such point.\n", pointName, object->name()); +DPRINTFR(ProbeVerbose, "Probes: Call to removeListener from \"%s\" " +"on %s failed, no such point.\n", point_name, object->name()); } return removed; } @@ -114,11 +121,13 @@ void ProbeManager::addPoint(ProbePoint ) { -DPRINTFR(ProbeVerbose, "Probes: Call to addPoint \"%s\" to %s.\n", point.getName(), object->name()); +DPRINTFR(ProbeVerbose, "Probes: Call to addPoint \"%s\" to %s.\n", +point.getName(), object->name()); for (auto p = points.begin(); p != points.end(); ++p) { if ((*p)->getName() == point.getName()) { -DPRINTFR(ProbeVerbose, "Probes: Call to addPoint \"%s\" to %s failed, already added.\n", point.getName(), object->name()); +DPRINTFR(ProbeVerbose, "Probes: Call to addPoint \"%s\" to %s " +"failed, already added.\n", point.getName(), object->name()); return; } } diff --git a/src/sim/probe/probe.hh b/src/sim/probe/probe.hh index 89b0a97..dede7ad 100644 --- a/src/sim/probe/probe.hh +++ b/src/sim/probe/probe.hh @@ -11,6 +11,9 @@ * unmodified and in its entirety in all distributions of the software, * modified or unmodified, in source code or in binary form. * + * Copyright (c) 2020 Inria + * All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: redistributions of source code must retain the above copyright @@ -39,21 +42,22 @@ * @file This file describes the base components used for the probe system. * There are currently 3 components: * - * ProbePoint:
[gem5-dev] Change in gem5/gem5[develop]: sim: Align coding style of probes
Daniel Carvalho has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/38697 ) Change subject: sim: Align coding style of probes .. sim: Align coding style of probes Fix coding style of probes for the following aspects: - Long lines - Return type of multi-line functions - Name of local parameters Also, added missing overrides Jira: https://gem5.atlassian.net/browse/GEM5-857 Change-Id: Ibd905d1941fc203ca8308f7a3930d58515b19a97 Signed-off-by: Daniel R. Carvalho --- M src/sim/probe/probe.cc M src/sim/probe/probe.hh 2 files changed, 49 insertions(+), 31 deletions(-) diff --git a/src/sim/probe/probe.cc b/src/sim/probe/probe.cc index b764db0..417ecf0 100644 --- a/src/sim/probe/probe.cc +++ b/src/sim/probe/probe.cc @@ -11,6 +11,9 @@ * unmodified and in its entirety in all distributions of the software, * modified or unmodified, in source code or in binary form. * + * Copyright (c) 2020 Inria + * All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: redistributions of source code must retain the above copyright @@ -75,35 +78,39 @@ } bool -ProbeManager::addListener(std::string pointName, ProbeListener ) +ProbeManager::addListener(std::string point_name, ProbeListener ) { -DPRINTFR(ProbeVerbose, "Probes: Call to addListener to \"%s\" on %s.\n", pointName, object->name()); +DPRINTFR(ProbeVerbose, "Probes: Call to addListener to \"%s\" on %s.\n", +point_name, object->name()); bool added = false; for (auto p = points.begin(); p != points.end(); ++p) { -if ((*p)->getName() == pointName) { +if ((*p)->getName() == point_name) { (*p)->addListener(); added = true; } } if (!added) { -DPRINTFR(ProbeVerbose, "Probes: Call to addListener to \"%s\" on %s failed, no such point.\n", pointName, object->name()); +DPRINTFR(ProbeVerbose, "Probes: Call to addListener to \"%s\" on " +"%s failed, no such point.\n", point_name, object->name()); } return added; } bool -ProbeManager::removeListener(std::string pointName, ProbeListener ) +ProbeManager::removeListener(std::string point_name, ProbeListener ) { -DPRINTFR(ProbeVerbose, "Probes: Call to removeListener from \"%s\" on %s.\n", pointName, object->name()); +DPRINTFR(ProbeVerbose, "Probes: Call to removeListener from \"%s\" on " +"%s.\n", point_name, object->name()); bool removed = false; for (auto p = points.begin(); p != points.end(); ++p) { -if ((*p)->getName() == pointName) { +if ((*p)->getName() == point_name) { (*p)->removeListener(); removed = true; } } if (!removed) { -DPRINTFR(ProbeVerbose, "Probes: Call to removeListener from \"%s\" on %s failed, no such point.\n", pointName, object->name()); +DPRINTFR(ProbeVerbose, "Probes: Call to removeListener from \"%s\" " +"on %s failed, no such point.\n", point_name, object->name()); } return removed; } @@ -111,11 +118,13 @@ void ProbeManager::addPoint(ProbePoint ) { -DPRINTFR(ProbeVerbose, "Probes: Call to addPoint \"%s\" to %s.\n", point.getName(), object->name()); +DPRINTFR(ProbeVerbose, "Probes: Call to addPoint \"%s\" to %s.\n", +point.getName(), object->name()); for (auto p = points.begin(); p != points.end(); ++p) { if ((*p)->getName() == point.getName()) { -DPRINTFR(ProbeVerbose, "Probes: Call to addPoint \"%s\" to %s failed, already added.\n", point.getName(), object->name()); +DPRINTFR(ProbeVerbose, "Probes: Call to addPoint \"%s\" to %s " +"failed, already added.\n", point.getName(), object->name()); return; } } diff --git a/src/sim/probe/probe.hh b/src/sim/probe/probe.hh index 5becc26..da8bc51 100644 --- a/src/sim/probe/probe.hh +++ b/src/sim/probe/probe.hh @@ -11,6 +11,9 @@ * unmodified and in its entirety in all distributions of the software, * modified or unmodified, in source code or in binary form. * + * Copyright (c) 2020 Inria + * All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: redistributions of source code must retain the above copyright @@ -39,21 +42,22 @@ * @file This file describes the base components used for the probe system. * There are currently 3 components: * - * ProbePoint: an event probe point i.e. send a notify from the point - * at which an instruction was committed. + * ProbePoint: an event probe point i.e. sends a notify from the + * point at which an instruction was