[gem5-dev] Re: [Suggestion] Replace gem5-users mailing-list with Discourse
I personally see the problem of people not answering questions to be a fixed constant regardless as to what medium we choose. It's a shame, but it's a "people problem" which I agree won't be solved by deploying new platforms. The reason for moving from the mailing-list is the mailing-list just doesn't appear to be an appropriate technology for tech support. I get emails every other week from someone who struggles to join gem5-users, and it normally turns out their gem5-user emails are ending up in spam. It's difficult to search through the mail archive to see if your question has been asked previously, it's hard to format your messages correctly, impossible to tag or categorize, and, I've already had students tell me they feel like reaching out over the gem5-users mailing list is awkward and embarrassing for the type of questions they want to ask. As a result, they just avoid doing so. My issue with slack is it's got poor threading, and I'd quite like a good archive of answered questions for people to search. Though I'm not opposed to it as it has the plus of being popular (as shallow as it may be, I find going with the most popular solution to a problem is often the best course-of-action). -- Dr. Bobby R. Bruce Room 2235, Kemper Hall, UC Davis Davis, CA, 95616 web: https://www.bobbybruce.net On Thu, Jul 2, 2020 at 3:45 PM Gabe Black via gem5-dev wrote: > I haven't used Slack before (yeah, I know, behind the times :-), but I > 100% agree with that last part. Having the perfect medium won't help if > there aren't enough people around to actually use it to answer questions. > > Gabe > > On Thu, Jul 2, 2020 at 9:45 AM Andreas Sandberg via gem5-dev < > gem5-dev@gem5.org> wrote: > >> I would probably be more in favour of a split email+Slack/Teams >> approach. Email works well for most discussion, but I like the quick >> more informal communication in a chat system. I have generally been very >> happy with the way Slack has worked when I have contributed to Zephyr in >> my spare time. As long as you have a threading email client, I can't see >> any benefits of a forum other than archiving (services like groups.io >> seems to solve that). >> >> I think we are fooling ourselves if we think switching from email to a >> different medium is going to solve underlying problem the there is a >> small number of experienced users that answer most of the questions on >> the lists. >> >> Cheers, >> Andreas >> >> On 10/06/2020 16:32, Daniel Gerzhoy via gem5-dev wrote: >> > I think this is a great idea! Emails threads aren't a great way to do >> this >> > just because there's no mechanism for well formatted responses to >> > particular points in someone's questions, posting code, or things like >> > "upvoting" responses. >> > >> > I see Daniel's point about less engagement if we move it to a forum, >> but I >> > think that could be alleviated by encouraging people to keep email >> > notifications up. >> > >> > Cheers, >> > >> > Dan >> > >> > On Wed, Jun 10, 2020 at 5:23 AM Giacomo Travaglini via gem5-dev < >> > gem5-dev@gem5.org> wrote: >> > >> >> I agree with Daniel and Ciro; it's difficult/annoying to navigate >> through >> >> old unanswered emails and I presume nobody does that at the moment. >> >> Most of the time if your email doesn't get a quick response as soon as >> it >> >> gets posted, you can forget about getting some help as time passes; >> there >> >> is a short window and you really have to hope someone flagged your >> email or >> >> got some time to address your problem. >> >> >> >> I wouldn't use JIRA to be honest for asking questions; that's beyond >> the >> >> scope of JIRA and it would be chaotic to mix Bug Reports, Improvement >> tasks >> >> with normal questions (like: I cannot build gem5 on my machine, or does >> >> anyone know how this works) >> >> >> >> Giacomo >> >> >> >> >> >> -Original Message- >> >> From: Ciro Santilli via gem5-dev >> >> Sent: 10 June 2020 09:21 >> >> To: gem5 Developer List >> >> Cc: Ciro Santilli >> >> Subject: [gem5-dev] Re: [Suggestion] Replace gem5-users mailing-list >> with >> >> Discourse >> >> >> >> I would just use JIRA. But after that, Discourse is the second best. >> And >> >> anything is better than a mailing list :-) >> >> >> From: Jason Lowe-Power via gem5-dev >> >> Sent: Tuesday, June 9, 2020 11:40 PM >> >> To: gem5 Developer List >> >> Cc: gem5 users mailing list ; Jason Lowe-Power < >> >> ja...@lowepower.com> >> >> Subject: [gem5-dev] Re: [Suggestion] Replace gem5-users mailing-list >> with >> >> Discourse >> >> >> >> +1 for Discourse :). >> >> >> >> Just to give a bit more context: I'm also trying to find a good forum >> for >> >> community engagement during my online Learning gem5 class this summer. >> I >> >> would like to find a platform that could be used generally for my class >> >> this summer, future iterations of the class, and general gem5 >> questions, as >> >> I believe there will be significant
[gem5-dev] Change in gem5/gem5[develop]: mem: Optionally share the backing store
Boris Shingarov has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/30994 ) Change subject: mem: Optionally share the backing store .. mem: Optionally share the backing store This patch adds the ability for a host-OS process external to gem5 to access the backing store via POSIX shared memory. The new param shared_backstore of the System object is the filename of the shared memory (i.e., the first argument to shm_open()). Change-Id: I98c948a32a15049a4515e6c02a14595fb5fe379f --- M src/mem/physical.cc M src/mem/physical.hh M src/sim/System.py M src/sim/system.cc 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/mem/physical.cc b/src/mem/physical.cc index 4bd812c..80632ce 100644 --- a/src/mem/physical.cc +++ b/src/mem/physical.cc @@ -71,8 +71,10 @@ PhysicalMemory::PhysicalMemory(const string& _name, const vector& _memories, - bool mmap_using_noreserve) : -_name(_name), size(0), mmapUsingNoReserve(mmap_using_noreserve) + bool mmap_using_noreserve, + const std::string& shared_backstore) : +_name(_name), size(0), mmapUsingNoReserve(mmap_using_noreserve), +sharedBackstore(shared_backstore) { if (mmap_using_noreserve) warn("Not reserving swap space. May cause SIGSEGV on actual usage\n"); @@ -192,7 +194,22 @@ // perform the actual mmap DPRINTF(AddrRanges, "Creating backing store for range %s with size %d\n", range.to_string(), range.size()); -int map_flags = MAP_ANON | MAP_PRIVATE; + +int shm_fd; +int map_flags; + +if (sharedBackstore.empty()) { +shm_fd = -1; +map_flags = MAP_ANON | MAP_PRIVATE; +} else { +DPRINTF(AddrRanges, "Sharing backing store as %s\n", +sharedBackstore.c_str()); +shm_fd = shm_open(sharedBackstore.c_str(), O_CREAT | O_RDWR, 0666); +if (shm_fd == -1) + panic("Shared memory failed"); +ftruncate(shm_fd, range.size()); +map_flags = MAP_SHARED; +} // to be able to simulate very large memories, the user can opt to // pass noreserve to mmap @@ -202,7 +219,7 @@ uint8_t* pmem = (uint8_t*) mmap(NULL, range.size(), PROT_READ | PROT_WRITE, -map_flags, -1, 0); +map_flags, shm_fd, 0); if (pmem == (uint8_t*) MAP_FAILED) { perror("mmap"); diff --git a/src/mem/physical.hh b/src/mem/physical.hh index 88a5cda..9d4ff9a 100644 --- a/src/mem/physical.hh +++ b/src/mem/physical.hh @@ -127,6 +127,8 @@ // Let the user choose if we reserve swap space when calling mmap const bool mmapUsingNoReserve; +const std::string sharedBackstore; + // The physical memory used to provide the memory in the simulated // system std::vector backingStore; @@ -158,7 +160,8 @@ */ PhysicalMemory(const std::string& _name, const std::vector& _memories, - bool mmap_using_noreserve); + bool mmap_using_noreserve, + const std::string& shared_backstore); /** * Unmap all the backing store we have used. diff --git a/src/sim/System.py b/src/sim/System.py index 61fbe0e..36b7e3f 100644 --- a/src/sim/System.py +++ b/src/sim/System.py @@ -78,6 +78,8 @@ # I/O bridge or cache mem_ranges = VectorParam.AddrRange([], "Ranges that constitute main memory") +shared_backstore = Param.String("", "backstore's shmem segment filename") + cache_line_size = Param.Unsigned(64, "Cache line size in bytes") redirect_paths = VectorParam.RedirectPath([], "Path redirections") diff --git a/src/sim/system.cc b/src/sim/system.cc index 7057a97..5f5ab54 100644 --- a/src/sim/system.cc +++ b/src/sim/system.cc @@ -213,7 +213,8 @@ #else kvmVM(nullptr), #endif - physmem(name() + ".physmem", p->memories, p->mmap_using_noreserve), + physmem(name() + ".physmem", p->memories, p->mmap_using_noreserve, + p->shared_backstore), memoryMode(p->mem_mode), _cacheLineSize(p->cache_line_size), workItemsBegin(0), -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/30994 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I98c948a32a15049a4515e6c02a14595fb5fe379f Gerrit-Change-Number: 30994 Gerrit-PatchSet: 1 Gerrit-Owner: Boris Shingarov Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: x86: Fix the indentation in arch/x86/stacktrace.hh.
Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/30959 ) Change subject: x86: Fix the indentation in arch/x86/stacktrace.hh. .. x86: Fix the indentation in arch/x86/stacktrace.hh. The namespace shouldn't be indented. Change-Id: I2bd5fa5adbbad62a35cfb54a9509c48d45076539 --- M src/arch/x86/stacktrace.hh 1 file changed, 49 insertions(+), 47 deletions(-) diff --git a/src/arch/x86/stacktrace.hh b/src/arch/x86/stacktrace.hh index 8ed89ec..c53362d 100644 --- a/src/arch/x86/stacktrace.hh +++ b/src/arch/x86/stacktrace.hh @@ -36,65 +36,67 @@ class ThreadContext; namespace X86ISA { -class StackTrace + +class StackTrace +{ + private: +ThreadContext *tc; +std::vector stack; + + private: +bool isEntry(Addr addr); +bool decodePrologue(Addr sp, Addr callpc, Addr func, int , Addr ); +bool decodeSave(MachInst inst, int , int ); +bool decodeStack(MachInst inst, int ); + +void trace(ThreadContext *tc, bool is_call); + + public: +StackTrace(); +StackTrace(ThreadContext *tc, const StaticInstPtr ); +~StackTrace(); + +void clear() { - private: -ThreadContext *tc; -std::vector stack; +tc = 0; +stack.clear(); +} - private: -bool isEntry(Addr addr); -bool decodePrologue(Addr sp, Addr callpc, Addr func, int , Addr ); -bool decodeSave(MachInst inst, int , int ); -bool decodeStack(MachInst inst, int ); +bool valid() const { return tc != NULL; } +bool trace(ThreadContext *tc, const StaticInstPtr ); -void trace(ThreadContext *tc, bool is_call); + public: +const std::vector () const { return stack; } - public: -StackTrace(); -StackTrace(ThreadContext *tc, const StaticInstPtr ); -~StackTrace(); - -void clear() -{ -tc = 0; -stack.clear(); -} - -bool valid() const { return tc != NULL; } -bool trace(ThreadContext *tc, const StaticInstPtr ); - - public: -const std::vector () const { return stack; } - -static const int user = 1; -static const int console = 2; -static const int unknown = 3; +static const int user = 1; +static const int console = 2; +static const int unknown = 3; #if TRACING_ON - private: -void dump(); + private: +void dump(); - public: -void dprintf() { if (DTRACE(Stack)) dump(); } + public: +void dprintf() { if (DTRACE(Stack)) dump(); } #else - public: -void dprintf() {} + public: +void dprintf() {} #endif -}; +}; -inline bool -StackTrace::trace(ThreadContext *tc, const StaticInstPtr ) -{ -if (!inst->isCall() && !inst->isReturn()) -return false; +inline bool +StackTrace::trace(ThreadContext *tc, const StaticInstPtr ) +{ +if (!inst->isCall() && !inst->isReturn()) +return false; -if (valid()) -clear(); +if (valid()) +clear(); -trace(tc, !inst->isReturn()); -return true; -} +trace(tc, !inst->isReturn()); +return true; } +} // namespace X86ISA + #endif // __ARCH_X86_STACKTRACE_HH__ -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/30959 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I2bd5fa5adbbad62a35cfb54a9509c48d45076539 Gerrit-Change-Number: 30959 Gerrit-PatchSet: 1 Gerrit-Owner: Gabe Black Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: cpu: Slightly modernize and simplify code in cpu/profile.(hh|cc).
Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/30960 ) Change subject: cpu: Slightly modernize and simplify code in cpu/profile.(hh|cc). .. cpu: Slightly modernize and simplify code in cpu/profile.(hh|cc). Change-Id: Ideb104d20b05ead2356cbfff2aac2e0173b5 --- M src/cpu/o3/thread_state.hh M src/cpu/profile.cc M src/cpu/profile.hh M src/cpu/simple_thread.cc 4 files changed, 42 insertions(+), 54 deletions(-) diff --git a/src/cpu/o3/thread_state.hh b/src/cpu/o3/thread_state.hh index 76e2011..833b2b8 100644 --- a/src/cpu/o3/thread_state.hh +++ b/src/cpu/o3/thread_state.hh @@ -154,7 +154,7 @@ { OutputStream *os( simout.create(csprintf("profile.%s.dat", cpu->name(; -profile->dump(tc, *os->stream()); +profile->dump(*os->stream()); simout.close(os); } }; diff --git a/src/cpu/profile.cc b/src/cpu/profile.cc index d1826e4..972346e 100644 --- a/src/cpu/profile.cc +++ b/src/cpu/profile.cc @@ -30,49 +30,39 @@ #include -#include "base/bitfield.hh" #include "base/callback.hh" #include "base/loader/symtab.hh" #include "base/statistics.hh" #include "base/trace.hh" -#include "cpu/base.hh" #include "cpu/thread_context.hh" -using namespace std; - -ProfileNode::ProfileNode() -: count(0) -{ } - void -ProfileNode::dump(const string , uint64_t id, - const Loader::SymbolTable , ostream ) const +ProfileNode::dump(const std::string , uint64_t id, + const Loader::SymbolTable , std::ostream ) const { ccprintf(os, "%#x %s %d ", id, symbol, count); -ChildList::const_iterator i, end = children.end(); -for (i = children.begin(); i != end; ++i) { -const ProfileNode *node = i->second; -ccprintf(os, "%#x ", (intptr_t)node); -} +for (const auto : children) +ccprintf(os, "%#x ", (intptr_t)(p.second)); ccprintf(os, "\n"); -Loader::SymbolTable::const_iterator it; -for (i = children.begin(); i != end; ++i) { -Addr addr = i->first; -string symbol; -if (addr == 1) +for (const auto : children) { +Addr addr = p.first; +std::string symbol; +if (addr == 1) { symbol = "user"; -else if (addr == 2) +} else if (addr == 2) { symbol = "console"; -else if (addr == 3) +} else if (addr == 3) { symbol = "unknown"; -else if ((it = symtab.find(addr)) != symtab.end()) +} else { +const auto it = symtab.find(addr); +panic_if(it == symtab.end(), + "Could not find symbol for address %#x\n", addr); symbol = it->name; -else -panic("could not find symbol for address %#x\n", addr); +} -const ProfileNode *node = i->second; +const auto *node = p.second; node->dump(symbol, (intptr_t)node, symtab, os); } } @@ -81,13 +71,12 @@ ProfileNode::clear() { count = 0; -ChildList::iterator i, end = children.end(); -for (i = children.begin(); i != end; ++i) -i->second->clear(); +for (const auto : children) +p.second->clear(); } -FunctionProfile::FunctionProfile(const Loader::SymbolTable &_symtab) -: reset(0), symtab(_symtab) +FunctionProfile::FunctionProfile(const Loader::SymbolTable &_symtab) : +symtab(_symtab) { reset = new MakeCallback::clear>(this); Stats::registerResetCallback(reset); @@ -95,17 +84,16 @@ FunctionProfile::~FunctionProfile() { -if (reset) -delete reset; +delete reset; } ProfileNode * -FunctionProfile::consume(const vector ) +FunctionProfile::consume(const std::vector ) { ProfileNode *current = for (int i = 0, size = stack.size(); i < size; ++i) { ProfileNode * = current->children[stack[size - i - 1]]; -if (ptr == NULL) +if (!ptr) ptr = new ProfileNode; current = ptr; @@ -122,23 +110,25 @@ } void -FunctionProfile::dump(ThreadContext *tc, ostream ) const +FunctionProfile::dump(std::ostream ) const { ccprintf(os, ">>>PC data\n"); -map::const_iterator i, end = pc_count.end(); -for (i = pc_count.begin(); i != end; ++i) { -Addr pc = i->first; -Counter count = i->second; +for (const auto : pc_count) { +Addr pc = p.first; +Counter count = p.second; -Loader::SymbolTable::const_iterator it; if (pc == 1) { ccprintf(os, "user %d\n", count); -} else if ((it = symtab.find(pc)) != symtab.end() && -!it->name.empty()) { -ccprintf(os, "%s %d\n", it->name, count); -} else { -ccprintf(os, "%#x %d\n", pc, count); +continue; } + +const auto it = symtab.find(pc); +if (it != symtab.end() && !it->name.empty()) { +
[gem5-dev] Change in gem5/gem5[develop]: arch: Delete the unused ProcessInfo class.
Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/30958 ) Change subject: arch: Delete the unused ProcessInfo class. .. arch: Delete the unused ProcessInfo class. Change-Id: Ie67f696005fa60e117e1e4e4e985aee5e767ccec --- M src/arch/arm/stacktrace.cc M src/arch/arm/stacktrace.hh M src/arch/mips/stacktrace.cc M src/arch/mips/stacktrace.hh M src/arch/power/stacktrace.cc M src/arch/power/stacktrace.hh M src/arch/riscv/stacktrace.cc M src/arch/riscv/stacktrace.hh M src/arch/x86/stacktrace.cc M src/arch/x86/stacktrace.hh 10 files changed, 0 insertions(+), 311 deletions(-) diff --git a/src/arch/arm/stacktrace.cc b/src/arch/arm/stacktrace.cc index 2c39576..a9f79e8 100644 --- a/src/arch/arm/stacktrace.cc +++ b/src/arch/arm/stacktrace.cc @@ -41,72 +41,6 @@ namespace ArmISA { -static int32_t -readSymbol(ThreadContext *tc, const std::string name) -{ -PortProxy = tc->getVirtProxy(); -const auto = tc->getSystemPtr()->workload->symtab(tc); - -auto it = symtab.find(name); -panic_if(it == symtab.end(), "Thread info not compiled into kernel."); - -return vp.read(it->address, GuestByteOrder); -} - -ProcessInfo::ProcessInfo(ThreadContext *_tc) : tc(_tc) -{ -thread_info_size = readSymbol(tc, "thread_info_size"); -task_struct_size = readSymbol(tc, "task_struct_size"); -task_off = readSymbol(tc, "thread_info_task"); -pid_off = readSymbol(tc, "task_struct_pid"); -name_off = readSymbol(tc, "task_struct_comm"); -} - -Addr -ProcessInfo::task(Addr ksp) const -{ -Addr base = ksp & ~0x1fff; -if (base == ULL(0xc000)) -return 0; - -Addr tsk; - -PortProxy = tc->getVirtProxy(); -tsk = vp.read(base + task_off, GuestByteOrder); - -return tsk; -} - -int -ProcessInfo::pid(Addr ksp) const -{ -Addr task = this->task(ksp); -if (!task) -return -1; - -uint16_t pd; - -PortProxy = tc->getVirtProxy(); -pd = vp.read(task + pid_off, GuestByteOrder); - -return pd; -} - -std::string -ProcessInfo::name(Addr ksp) const -{ -Addr task = this->task(ksp); -if (!task) -return "unknown"; - -char comm[256]; -tc->getVirtProxy().readString(comm, task + name_off, sizeof(comm)); -if (!comm[0]) -return "startup"; - -return comm; -} - StackTrace::StackTrace() : tc(0), stack(64) { diff --git a/src/arch/arm/stacktrace.hh b/src/arch/arm/stacktrace.hh index fd0ec1b..61bea29 100644 --- a/src/arch/arm/stacktrace.hh +++ b/src/arch/arm/stacktrace.hh @@ -37,27 +37,6 @@ namespace ArmISA { -class StackTrace; - -class ProcessInfo -{ - private: -ThreadContext *tc; - -int thread_info_size; -int task_struct_size; -int task_off; -int pid_off; -int name_off; - - public: -ProcessInfo(ThreadContext *_tc); - -Addr task(Addr ksp) const; -int pid(Addr ksp) const; -std::string name(Addr ksp) const; -}; - class StackTrace { protected: diff --git a/src/arch/mips/stacktrace.cc b/src/arch/mips/stacktrace.cc index ec5597c..0384e2b 100644 --- a/src/arch/mips/stacktrace.cc +++ b/src/arch/mips/stacktrace.cc @@ -40,54 +40,6 @@ using namespace MipsISA; -ProcessInfo::ProcessInfo(ThreadContext *_tc) : tc(_tc) -{} - -Addr -ProcessInfo::task(Addr ksp) const -{ -Addr base = ksp & ~0x3fff; -if (base == ULL(0xfc00)) -return 0; - -Addr tsk; - -PortProxy = tc->getVirtProxy(); -tsk = vp.read(base + task_off, GuestByteOrder); - -return tsk; -} - -int -ProcessInfo::pid(Addr ksp) const -{ -Addr task = this->task(ksp); -if (!task) -return -1; - -uint16_t pd; - -PortProxy = tc->getVirtProxy(); -pd = vp.read(task + pid_off, GuestByteOrder); - -return pd; -} - -std::string -ProcessInfo::name(Addr ksp) const -{ -Addr task = this->task(ksp); -if (!task) -return "console"; - -char comm[256]; -tc->getVirtProxy().readString(comm, task + name_off, sizeof(comm)); -if (!comm[0]) -return "startup"; - -return comm; -} - StackTrace::StackTrace() : tc(0), stack(64) { diff --git a/src/arch/mips/stacktrace.hh b/src/arch/mips/stacktrace.hh index eb3a95a..9c02170 100644 --- a/src/arch/mips/stacktrace.hh +++ b/src/arch/mips/stacktrace.hh @@ -38,23 +38,6 @@ namespace MipsISA { -class ProcessInfo -{ - private: -ThreadContext *tc; - -int task_off; -int pid_off; -int name_off; - - public: -ProcessInfo(ThreadContext *_tc); - -Addr task(Addr ksp) const; -int pid(Addr ksp) const; -std::string name(Addr ksp) const; -}; - class StackTrace { protected: diff --git a/src/arch/power/stacktrace.cc b/src/arch/power/stacktrace.cc index 64ea926..84f1b65 100644 --- a/src/arch/power/stacktrace.cc +++ b/src/arch/power/stacktrace.cc @@ -36,32 +36,6 @@ namespace PowerISA { -ProcessInfo::ProcessInfo(ThreadContext *_tc) -{ -