remove really nasty ugly examples
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 05 May 2011 09:49:21 +0200
changeset 67fb900a594421
parent 66 2fe1f3e576c9
child 68 a384d3f2f086
remove really nasty ugly examples
example/dce-iperf.cc
example/dce-linear.cc
example/dce-netlink.cc
example/memory-usage.cc
example/memory-usage.h
example/run-linear-udp-perf.sh
example/run-loader.sh
example/uss-for-pid.py
     1.1 --- a/example/dce-iperf.cc	Thu May 05 09:28:21 2011 +0200
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,104 +0,0 @@
     1.4 -#include "ns3/network-module.h"
     1.5 -#include "ns3/dce-application-helper.h"
     1.6 -#include "ns3/dce-manager-helper.h"
     1.7 -#include "ns3/core-module.h"
     1.8 -#include "ns3/internet-module.h"
     1.9 -#include "ns3/point-to-point-module.h"
    1.10 -
    1.11 -using namespace ns3;
    1.12 -
    1.13 -static std::string Ipv4AddressToString (Ipv4Address ad)
    1.14 -{
    1.15 -  std::ostringstream oss;
    1.16 -  ad.Print (oss);
    1.17 -  return oss.str ();
    1.18 -}
    1.19 -
    1.20 -int main (int argc, char *argv[])
    1.21 -{
    1.22 -  Config::SetDefault ("ns3::Ipv4L3Protocol::DefaultTtl", UintegerValue (255));
    1.23 -  std::string delay = "1ns";
    1.24 -  std::string rate = "5Mbps";
    1.25 -  uint32_t nHops = 1;
    1.26 -  CommandLine cmd;
    1.27 -  cmd.AddValue ("Delay", "link delay", delay);
    1.28 -  cmd.AddValue ("Bandwidth", "link bandwidth", rate);
    1.29 -  cmd.AddValue ("nHops", "number of hops between source and destination", nHops);
    1.30 -  cmd.Parse (argc, argv);
    1.31 -
    1.32 -  NodeContainer nodes;
    1.33 -  nodes.Create (nHops+1);
    1.34 -
    1.35 -  PointToPointHelper p2p;
    1.36 -  p2p.SetDeviceAttribute ("DataRate", StringValue (rate));
    1.37 -  p2p.SetChannelAttribute ("Delay", StringValue (delay));
    1.38 -  std::vector<NetDeviceContainer> devs;
    1.39 -  for (uint32_t i = 0; i < nHops; i++)
    1.40 -    {
    1.41 -      NodeContainer linkNodes;
    1.42 -      linkNodes.Add (nodes.Get (i));
    1.43 -      linkNodes.Add (nodes.Get (i+1));
    1.44 -      NetDeviceContainer dev = p2p.Install (linkNodes);
    1.45 -      devs.push_back (dev);
    1.46 -    }
    1.47 -
    1.48 -  // add an ip stack
    1.49 -  InternetStackHelper stack;
    1.50 -  //stack.SetTcp ("ns3::NscTcpL4Protocol", "Library", StringValue ("liblinux2.6.26.so"));
    1.51 -  stack.Install (nodes);
    1.52 -
    1.53 -  // ip address assignment
    1.54 -  Ipv4AddressHelper ipv4;
    1.55 -  std::vector<Ipv4InterfaceContainer> interfaces;
    1.56 -  ipv4.SetBase ("10.1.1.0", "255.255.255.0");
    1.57 -  for (std::vector<NetDeviceContainer>::const_iterator i = devs.begin (); i != devs.end (); ++i)
    1.58 -    {
    1.59 -      Ipv4InterfaceContainer interface = ipv4.Assign (*i);
    1.60 -      interfaces.push_back (interface);
    1.61 -      ipv4.NewNetwork ();
    1.62 -    }
    1.63 -
    1.64 -  // setup ip routes
    1.65 -  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
    1.66 -
    1.67 -
    1.68 -  // start the ping binaries.
    1.69 -  DceManagerHelper processManager;
    1.70 -  processManager.Install (nodes);
    1.71 -  DceApplicationHelper process;
    1.72 -  process.SetStackSize (1<<16);
    1.73 -  ApplicationContainer apps;
    1.74 -
    1.75 -  Ptr<Node> serverNode = nodes.Get (nHops);
    1.76 -  Ptr<Node> clientNode = nodes.Get (0);
    1.77 -  Ipv4Address serverAddress = interfaces[nHops-1].GetAddress (1, 0);
    1.78 -
    1.79 -  process.SetBinary ("build/debug/iperf");
    1.80 -  process.AddArgument ("-s");
    1.81 -  process.AddArgument ("-x");
    1.82 -  process.AddArgument ("CDMSV");
    1.83 -  //process.AddArgument ("-u");
    1.84 -  apps = process.Install (serverNode);
    1.85 -  apps.Start (Seconds (1.0));
    1.86 -
    1.87 -  process.SetBinary ("build/debug/iperf");
    1.88 -  process.ResetArguments ();
    1.89 -  //process.AddArgument ("-u");
    1.90 -  process.AddArgument ("-c");
    1.91 -  process.AddArgument (Ipv4AddressToString (serverAddress));
    1.92 -  process.AddArgument ("-y");
    1.93 -  process.AddArgument ("C");
    1.94 -  process.AddArgument ("-i");
    1.95 -  process.AddArgument ("1");
    1.96 -  apps = process.Install (clientNode);
    1.97 -  apps.Start (Seconds (2.0));
    1.98 -
    1.99 -  //PointToPointHelper::EnablePcapAll ("process-iperf");
   1.100 -
   1.101 -  Simulator::Stop (Seconds (10.0));
   1.102 -  Simulator::Run ();
   1.103 -  Simulator::Destroy ();
   1.104 -
   1.105 -
   1.106 -  return 0;
   1.107 -}
     2.1 --- a/example/dce-linear.cc	Thu May 05 09:28:21 2011 +0200
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,162 +0,0 @@
     2.4 -#include "ns3/dce-module.h"
     2.5 -#include "ns3/core-module.h"
     2.6 -#include "ns3/network-module.h"
     2.7 -#include "ns3/internet-module.h"
     2.8 -#include "ns3/point-to-point-module.h"
     2.9 -#include <sys/time.h>
    2.10 -#include <sys/resource.h>
    2.11 -#include <fstream>
    2.12 -#include <string>
    2.13 -
    2.14 -
    2.15 -using namespace ns3;
    2.16 -
    2.17 -static std::string Ipv4AddressToString (Ipv4Address ad)
    2.18 -{
    2.19 -  std::ostringstream oss;
    2.20 -  ad.Print (oss);
    2.21 -  return oss.str ();
    2.22 -}
    2.23 -
    2.24 -static unsigned long GetUss (void)
    2.25 -{
    2.26 -  pid_t pid = getpid ();
    2.27 -  std::ostringstream oss;
    2.28 -  oss << "examples/process/uss-for-pid.py " << pid;
    2.29 -  FILE *file = popen (oss.str ().c_str (), "r");
    2.30 -  unsigned long uss;
    2.31 -  fscanf (file, "%lu", &uss);
    2.32 -  fclose (file);
    2.33 -  return uss;
    2.34 -}
    2.35 -#if 0
    2.36 -static unsigned long GetNPhysicalPages (void)
    2.37 -{
    2.38 -  return 0;
    2.39 -}
    2.40 -#endif
    2.41 -static unsigned long GetUnsharedSize (void)
    2.42 -{
    2.43 -  struct rusage usage;
    2.44 -  int status;
    2.45 -  status = getrusage (RUSAGE_SELF, &usage);
    2.46 -  NS_ASSERT (status == 0);
    2.47 -  return usage.ru_idrss + usage.ru_isrss;
    2.48 -}
    2.49 -
    2.50 -static std::string GetPeakMemoryUsed (void)
    2.51 -{
    2.52 -  std::ifstream is;
    2.53 -  is.open ("/proc/self/status");
    2.54 -  while (!is.eof ())
    2.55 -    {
    2.56 -      std::string line;
    2.57 -      std::getline (is, line);
    2.58 -      std::string::size_type i = line.find ("VmPeak");
    2.59 -      if (i == 0)
    2.60 -	{
    2.61 -	  is.close();
    2.62 -	  return line;
    2.63 -	}
    2.64 -    }
    2.65 -  is.close ();
    2.66 -  return "";
    2.67 -}
    2.68 -
    2.69 -static void PrintMemory (void)
    2.70 -{
    2.71 -  std::cerr << "uss=" << GetUss () << std::endl;
    2.72 -  std::cerr << "peak=" << GetPeakMemoryUsed () << std::endl;
    2.73 -  std::cerr << "unshared=" << GetUnsharedSize () << std::endl;
    2.74 -}
    2.75 -
    2.76 -
    2.77 -int main (int argc, char *argv[])
    2.78 -{
    2.79 -  Config::SetDefault ("ns3::Ipv4L3Protocol::DefaultTtl", UintegerValue (255));
    2.80 -  std::string delay = "1ns";
    2.81 -  std::string rate = "5Mbps";
    2.82 -  uint32_t size = 1;
    2.83 -  CommandLine cmd;
    2.84 -  cmd.AddValue ("Delay", "link delay", delay);
    2.85 -  cmd.AddValue ("Bandwidth", "link bandwidth", rate);
    2.86 -  cmd.AddValue ("Size", "number of nodes in ring", size);
    2.87 -  cmd.Parse (argc, argv);
    2.88 -
    2.89 -  NodeContainer nodes;
    2.90 -  nodes.Create (size);
    2.91 -
    2.92 -  Ipv4StaticRoutingHelper staticHelper;
    2.93 -  InternetStackHelper stack;
    2.94 -  stack.SetRoutingHelper (staticHelper);
    2.95 -  stack.Install (nodes);
    2.96 -
    2.97 -  DceManagerHelper processManager;
    2.98 -  processManager.Install (nodes);
    2.99 -
   2.100 -  PointToPointHelper p2p;
   2.101 -  p2p.SetDeviceAttribute ("DataRate", StringValue (rate));
   2.102 -  p2p.SetChannelAttribute ("Delay", StringValue (delay));
   2.103 -  std::vector<NetDeviceContainer> devs;
   2.104 -  for (uint32_t i = 0; i < size; i++)
   2.105 -    {
   2.106 -      NodeContainer linkNodes;
   2.107 -      linkNodes.Add (nodes.Get (i));
   2.108 -      linkNodes.Add (nodes.Get ((i+1)%size));
   2.109 -      NetDeviceContainer dev = p2p.Install (linkNodes);
   2.110 -      devs.push_back (dev);
   2.111 -    }
   2.112 -  
   2.113 -  std::vector<std::pair<Ptr<Node>, Ipv4Address> > pairs;
   2.114 -
   2.115 -  Ipv4AddressHelper addressAlloc;
   2.116 -  Ipv4Mask mask = Ipv4Mask ("255.255.0.0");
   2.117 -  addressAlloc.SetBase ("10.1.0.0", mask);
   2.118 -  for (uint32_t i = 0; i < size; i++)
   2.119 -    {
   2.120 -      Ptr<Node> node = nodes.Get (i);
   2.121 -      Ptr<Node> nextNode = nodes.Get ((i+1)%size);
   2.122 -      Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
   2.123 -      Ptr<Ipv4> nextIpv4 = nextNode->GetObject<Ipv4> ();
   2.124 -      Ptr<NetDevice> dev = node->GetDevice (2);
   2.125 -      Ptr<NetDevice> nextDev = nextNode->GetDevice (1);
   2.126 -      Ipv4Address ip = addressAlloc.NewAddress ();
   2.127 -      Ipv4Address nextIp = addressAlloc.NewAddress ();
   2.128 -      uint32_t interf = ipv4->AddInterface (dev);
   2.129 -      uint32_t nextInterf = nextIpv4->AddInterface (nextDev);
   2.130 -      ipv4->AddAddress (interf, Ipv4InterfaceAddress (ip, mask));
   2.131 -      nextIpv4->AddAddress (nextInterf, Ipv4InterfaceAddress (nextIp, mask));
   2.132 -      ipv4->SetUp (interf);
   2.133 -      nextIpv4->SetUp (nextInterf);
   2.134 -
   2.135 -      Ptr<Ipv4StaticRouting> routing = DynamicCast<Ipv4StaticRouting> (ipv4->GetRoutingProtocol ());
   2.136 -      routing->SetDefaultRoute (nextIp, interf, 0);
   2.137 -
   2.138 -      pairs.push_back (std::make_pair (nextNode, ip));
   2.139 -    }
   2.140 -
   2.141 -  for (uint32_t i = 0; i < pairs.size (); i++)
   2.142 -    {
   2.143 -      std::pair<Ptr<Node>,Ipv4Address> pair = pairs[i];
   2.144 -      DceApplicationHelper process;
   2.145 -      process.SetStackSize (1<<16);
   2.146 -      process.SetBinary ("build/debug/ping");
   2.147 -      process.AddArgument ("-c");
   2.148 -      process.AddArgument ("1");
   2.149 -      process.AddArgument (Ipv4AddressToString (pair.second));
   2.150 -      ApplicationContainer apps;
   2.151 -      apps = process.Install (pair.first);
   2.152 -      apps.Start (Seconds (2.0));
   2.153 -    }
   2.154 -
   2.155 -  //p2p.EnablePcapAll ("process-ring");
   2.156 -
   2.157 -  PrintMemory ();
   2.158 -  Simulator::Schedule (Seconds (2.00001), &PrintMemory);
   2.159 -
   2.160 -  Simulator::Run ();
   2.161 -
   2.162 -  Simulator::Destroy ();
   2.163 -
   2.164 -  return 0;
   2.165 -}
     3.1 --- a/example/dce-netlink.cc	Thu May 05 09:28:21 2011 +0200
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,74 +0,0 @@
     3.4 -#include "ns3/core-module.h"
     3.5 -#include "ns3/dce-module.h"
     3.6 -#include "ns3/network-module.h"
     3.7 -#include <fstream>
     3.8 -
     3.9 -using namespace ns3;
    3.10 -
    3.11 -int main (int argc, char *argv[])
    3.12 -{
    3.13 -  CommandLine cmd;
    3.14 -  cmd.Parse (argc, argv);
    3.15 -
    3.16 -  NodeContainer nodes;
    3.17 -  nodes.Create (1);
    3.18 -
    3.19 -  DceManagerHelper processManager;
    3.20 -  processManager.SetNetworkStack("ns3::LinuxSocketFdFactory",
    3.21 -				 "Library", StringValue ("libnet-next-2.6.so"));
    3.22 -  //processManager.SetLoader("ns3::CopyLoaderFactory");
    3.23 -  processManager.Install (nodes);
    3.24 -
    3.25 -  DceApplicationHelper process;
    3.26 -  ApplicationContainer apps;
    3.27 -  process.SetBinary ("build/debug/ip");
    3.28 -  process.SetStackSize (1<<16);
    3.29 -#if 0
    3.30 -  process.ParseArguments("link show");
    3.31 -  apps = process.Install (nodes.Get (0));
    3.32 -  apps.Start (Seconds (1.0));
    3.33 -#endif
    3.34 -#if 1
    3.35 -  process.ResetArguments();
    3.36 -  process.ParseArguments("-f inet addr add local 127.0.0.1/8 scope host dev lo");
    3.37 -  apps = process.Install (nodes.Get (0));
    3.38 -  apps.Start (Seconds (2.0));
    3.39 -  process.ResetArguments();
    3.40 -  process.ParseArguments("link set lo up");
    3.41 -  apps = process.Install (nodes.Get (0));
    3.42 -  apps.Start (Seconds (3.0));
    3.43 -  process.ResetArguments();
    3.44 -  process.ParseArguments("route list table all");
    3.45 -  apps = process.Install (nodes.Get (0));
    3.46 -  apps.Start (Seconds (3.1));
    3.47 -#endif
    3.48 -
    3.49 -  process.ResetArguments();
    3.50 -  process.ParseArguments("addr show dev lo");
    3.51 -  apps = process.Install (nodes.Get (0));
    3.52 -  apps.Start (Seconds (3.0));
    3.53 -
    3.54 -#if 0
    3.55 -  process.SetBinary ("build/debug/examples/process/process-udp-server");
    3.56 -  process.ResetArguments();
    3.57 -  apps = process.Install (nodes.Get (0));
    3.58 -  apps.Start (Seconds (4.0));
    3.59 -
    3.60 -  process.SetBinary ("build/debug/examples/process/process-udp-client");
    3.61 -  process.ResetArguments();
    3.62 -  process.AddArgument ("127.0.0.1");
    3.63 -  apps = process.Install (nodes.Get (0));
    3.64 -  apps.Start (Seconds (4.5));
    3.65 -#else
    3.66 -  process.SetBinary ("build/debug/examples/process/process-tcp-loopback");
    3.67 -  process.ResetArguments();
    3.68 -  apps = process.Install (nodes.Get (0));
    3.69 -  apps.Start (Seconds (4.0));
    3.70 -#endif
    3.71 -
    3.72 -  Simulator::Stop (Seconds(1000100.0));
    3.73 -  Simulator::Run ();
    3.74 -  Simulator::Destroy ();
    3.75 -
    3.76 -  return 0;
    3.77 -}
     4.1 --- a/example/memory-usage.cc	Thu May 05 09:28:21 2011 +0200
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,106 +0,0 @@
     4.4 -#include "memory-usage.h"
     4.5 -#include "ns3/log.h"
     4.6 -#include "ns3/assert.h"
     4.7 -#include <string.h>
     4.8 -#include <errno.h>
     4.9 -#include <sys/types.h>
    4.10 -#include <sys/stat.h>
    4.11 -#include <sys/wait.h>
    4.12 -#include <unistd.h>
    4.13 -#include <algorithm>
    4.14 -#include <sstream>
    4.15 -#include <string>
    4.16 -
    4.17 -
    4.18 -namespace ns3 {
    4.19 -
    4.20 -NS_LOG_COMPONENT_DEFINE("MemoryUsage");
    4.21 -
    4.22 -static long AsLong (std::string str)
    4.23 -{
    4.24 -  std::istringstream iss;
    4.25 -  iss.str (str);
    4.26 -  long l;
    4.27 -  iss >> l;
    4.28 -  return l;
    4.29 -}
    4.30 -
    4.31 -long GetCurrentMemoryUsage (void)
    4.32 -{
    4.33 -  int pipefd[2];
    4.34 -  int retval = ::pipe (pipefd);
    4.35 -  if (retval == -1)
    4.36 -    {
    4.37 -      NS_LOG_ERROR ("Cannot create pipe: " << ::strerror (errno));
    4.38 -      return 0;
    4.39 -    }
    4.40 -  pid_t pid = ::fork ();
    4.41 -  if (pid == 0)
    4.42 -    {
    4.43 -      // child.
    4.44 -      NS_LOG_DEBUG ("Child");
    4.45 -      ::close (pipefd[0]);
    4.46 -      int tmp;
    4.47 -      tmp = dup2 (pipefd[1], 1);
    4.48 -      if (tmp == -1)
    4.49 -	{
    4.50 -	  NS_LOG_ERROR ("Cannot redirect stdout");
    4.51 -	  ::exit (0);
    4.52 -	}
    4.53 -      retval = ::execl ("/usr/bin/smem", "smem", "-c", "pid uss", (char *)NULL);
    4.54 -      if (retval == -1)
    4.55 -	{
    4.56 -	  NS_LOG_ERROR ("Cannot execl smem: " << ::strerror (errno));
    4.57 -	}
    4.58 -      ::close (pipefd[1]);
    4.59 -      ::_exit (EXIT_SUCCESS);
    4.60 -    }
    4.61 -  else
    4.62 -    {
    4.63 -      // parent.
    4.64 -      NS_LOG_DEBUG ("Parent");
    4.65 -      ::close (pipefd[1]);
    4.66 -      std::string output;
    4.67 -      uint8_t c;
    4.68 -      ssize_t bytesRead = ::read (pipefd[0], &c, 1);
    4.69 -      while (bytesRead == 1)
    4.70 -	{
    4.71 -	  output.push_back (c);
    4.72 -	  bytesRead = ::read (pipefd[0], &c, 1);
    4.73 -	}
    4.74 -      waitpid (pid, 0, 0);
    4.75 -      ::close (pipefd[0]);
    4.76 -
    4.77 -      pid = getpid ();
    4.78 -      std::istringstream iss;
    4.79 -      iss.str (output);
    4.80 -      while (!iss.eof ())
    4.81 -	{
    4.82 -	  std::string line;
    4.83 -	  std::getline (iss, line);
    4.84 -	  std::string::size_type cur = 0, next = 0;
    4.85 -	  cur = line.find_first_not_of (" \t", cur);
    4.86 -	  next = line.find_first_of (" \t", cur);
    4.87 -	  if (cur == std::string::npos || next == std::string::npos)
    4.88 -	    {
    4.89 -	      break;
    4.90 -	    }
    4.91 -	  std::string line_pid = line.substr(cur, next-cur);
    4.92 -	  cur = next+1;
    4.93 -	  cur = line.find_first_not_of (" \t", cur);
    4.94 -	  next = line.find_first_of (" \t", cur);
    4.95 -	  if (cur == std::string::npos || next == std::string::npos)
    4.96 -	    {
    4.97 -	      break;
    4.98 -	    }
    4.99 -	  std::string line_uss = line.substr(cur, next-cur);
   4.100 -	  if (AsLong (line_pid) == pid)
   4.101 -	    {
   4.102 -	      return AsLong (line_uss);
   4.103 -	    }
   4.104 -	}
   4.105 -    }
   4.106 -  return 0;
   4.107 -}
   4.108 -
   4.109 -} // namespace ns3
     5.1 --- a/example/memory-usage.h	Thu May 05 09:28:21 2011 +0200
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,5 +0,0 @@
     5.4 -namespace ns3 {
     5.5 -
     5.6 -long GetCurrentMemoryUsage (void);
     5.7 -
     5.8 -} // namespace ns3
     6.1 --- a/example/run-linear-udp-perf.sh	Thu May 05 09:28:21 2011 +0200
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,28 +0,0 @@
     6.4 -
     6.5 -nodes="1 2 3 4 8 10 16 20"
     6.6 -DCE_RUNNER="./build/optimized/src/dce/utils/dce-runner"
     6.7 -PRGM="./build/optimized/src/dce/example/linear-udp-perf"
     6.8 -CONSTANTS="--TxBandwidth=1000000 --LinkBandwidth=2MBps --ns3::TaskManager::FiberManagerType=UcontextFiberManager --Duration=200s"
     6.9 -args_a="--Ns3App=true"
    6.10 -args_b="--Ns3App=false"
    6.11 -args_c="--Ns3App=false --LinuxPath=./libnet-next-2.6.so"
    6.12 -name_a="dce-none"
    6.13 -name_b="dce-user"
    6.14 -name_c="dce-user+kernel"
    6.15 -for node in ${nodes}; do
    6.16 -    for exp in a b c; do
    6.17 -	tmp=name_${exp}
    6.18 -	NAME=${!tmp}
    6.19 -	echo -n "${node},${NAME},";
    6.20 -        MEM=0;
    6.21 -        for i in 0 1 2 3 4 5 6 7 8 9; do
    6.22 -	    tmp=args_${exp}
    6.23 -	    ARGS=${!tmp}
    6.24 -	    OUT=`${DCE_RUNNER} ${PRGM} ${CONSTANTS} ${ARGS} --Size=${node} |cut -d ',' -f3,4|tail -1`;
    6.25 -	    US=`echo $OUT|sed -e 's/,.*//g'`;
    6.26 -	    MEM=`echo $OUT|sed -e 's/.*,//g'`;
    6.27 -	    echo -n "${US},";
    6.28 -	done;
    6.29 -	echo ${MEM};
    6.30 -    done;
    6.31 -done
     7.1 --- a/example/run-loader.sh	Thu May 05 09:28:21 2011 +0200
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,20 +0,0 @@
     7.4 -#/bin/bash
     7.5 -nodes="1 2 3 4 8 10 16 20 32 50 63"
     7.6 -loaders="Cooja Dlm"
     7.7 -ARGS="--TxBandwidth=1000000 --LinkBandwidth=2MBps --ns3::TaskManager::FiberManagerType=UcontextFiberManager --LinuxPath=./libnet-next-2.6-pic.so --Duration=200s"
     7.8 -PRGM="./build/optimized/src/dce/example/linear-udp-perf"
     7.9 -DCE_RUNNER="./build/optimized/src/dce/utils/dce-runner"
    7.10 -for node in ${nodes}; do
    7.11 -    for loader in ${loaders}; do
    7.12 -	echo -n "${node},${loader},";
    7.13 -        MEM=0;
    7.14 -        for i in 0 1 2 3 4 5 6 7 8 9; do
    7.15 -	    if test ${loader} == "Dlm"; then CMD="${DCE_RUNNER} ${PRGM}"; else CMD=${PRGM}; fi
    7.16 -	    OUT=`${CMD} ${ARGS} --ns3::DceManagerHelper::LoaderFactory=ns3::${loader}LoaderFactory[] --Size=${node} |cut -d ',' -f3,4|tail -1`;
    7.17 -	    US=`echo $OUT|sed -e 's/,.*//g'`;
    7.18 -	    MEM=`echo $OUT|sed -e 's/.*,//g'`;
    7.19 -	    echo -n "${US},";
    7.20 -	done;
    7.21 -	echo ${MEM};
    7.22 -    done;
    7.23 -done
    7.24 \ No newline at end of file
     8.1 --- a/example/uss-for-pid.py	Thu May 05 09:28:21 2011 +0200
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,21 +0,0 @@
     8.4 -#!/usr/bin/env python
     8.5 -
     8.6 -import subprocess
     8.7 -import sys
     8.8 -import re
     8.9 -
    8.10 -pid = sys.argv[1]
    8.11 -
    8.12 -smem = subprocess.Popen (['smem', '-c', 'pid uss'],
    8.13 -                         stdout=subprocess.PIPE,
    8.14 -                         stderr=subprocess.STDOUT,
    8.15 -                         stdin=subprocess.PIPE)
    8.16 -(out, err) = smem.communicate ('')
    8.17 -
    8.18 -reg = re.compile('([0-9]+)[^0-9]+([0-9]+)')
    8.19 -for line in out.split('\n'):
    8.20 -    m = reg.search (line)
    8.21 -    if m is not None:
    8.22 -        if m.group(1) == pid:
    8.23 -            print m.group(2)
    8.24 -            sys.exit (0)