Jump to content

Recommended Posts

  • 40 years later...
Posted

Hi, i want use gprof with MaNGOS (gprof is a gnu profiler, for find what code is long to execute).

I have read on the gprof website, i must add "-pg" in a configure's flags but if i do that, MaNGOS not generate a gmon.out file.

Thanks you :)

Posted

Ok, i have solved my problem : MaNGOS must be closed normaly for make a gmon.out.

I have make a dump, with 2.5 k ppl in 1 hour uptime

Flat profile:

Each sample counts as 0.01 seconds.
 %   cumulative   self              self     total           
time   seconds   seconds    calls   s/call   s/call  name    
 6.11     36.70    36.70 187541438     0.00     0.00  WorldSocket::Update()
 5.62     70.46    33.76  4432264     0.00     0.00  AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes, unsigned int, unsigned int, Unit*, unsigned int)
 3.50     91.51    21.05 26155543     0.00     0.00  Object::BuildValuesUpdate(unsigned char, ByteBuffer*, UpdateMask*, Player*) const
 2.94    109.17    17.66                             void VMAP::TreeNode::intersectRay<VMAP::IntersectionCallBack<VMAP::TriangleBox>, VMAP::TreeNode, VMAP::TriangleBox>(G3D::Ray const&, VMAP::IntersectionCallBack<VMAP::TriangleBox>&, float&, VMAP::NodeValueAccess<VMAP::TreeNode, VMAP::TriangleBox> const&, bool, bool) const
 2.78    125.90    16.74 651569430     0.00     0.00  AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const*, AchievementEntry const*)
 2.60    141.53    15.63 353754301     0.00     0.00  Cell::Cell(CoordPair<1024u> const&)
 2.32    155.46    13.93 3125345327     0.00     0.00  Object::GetUInt32Value(unsigned short) const
 2.30    169.26    13.80  7294104     0.00     0.00  Object::_SetUpdateBits(UpdateMask*, Player*) const
 2.15    182.16    12.90 15979322     0.00     0.00  Unit::_UpdateSpells(unsigned int)
 2.11    194.82    12.66 196500869     0.00     0.00  MaNGOS::MessageDeliverer::Visit(GridRefManager<Player>&)
 2.04    207.07    12.25 2509259284     0.00     0.00  Map::getNGrid(unsigned int, unsigned int) const
 1.73    217.47    10.40  4230911     0.00     0.00  Unit::RemoveAurasWithInterruptFlags(unsigned int)
 1.62    227.20     9.73 103419779     0.00     0.00  WorldSocket::SendPacket(WorldPacket const&)
 1.42    235.71     8.51   757942     0.00     0.00  WorldObject::BuildUpdateData(std::tr1::unordered_map<Player*, UpdateData, std::tr1::hash<Player*>, std::equal_to<Player*>, std::allocator<std::Pair<Player* const, UpdateData> > >&)
 1.39    244.08     8.37     2283     0.00     0.01  AuctionHouseObject::BuildListAuctionItems(WorldPacket&, Player*, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int&, unsigned int&)
 1.26    251.67     7.60 813909499     0.00     0.00  std::vector<unsigned char, std::allocator<unsigned char> >::_M_fill_insert(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned long, unsigned char const&)
 1.23    259.09     7.42 203383608     0.00     0.00  Aura::Update(unsigned int)
 1.12    265.85     6.76 15303679     0.00     0.00  Unit::Update(unsigned int)
 1.10    272.47     6.62 47294526     0.00     0.00  MaNGOS::CreatureRelocationNotifier::Visit(GridRefManager<Creature>&)
 1.07    278.91     6.44    96557     0.00     0.00  Player::learnSkillRewardedSpells(unsigned int, unsigned int)
 1.06    285.30     6.39 14757682     0.00     0.00  void Map::Visit<MaNGOS::SingleThreaded<ACE_RW_Thread_Mutex>::Lock, MaNGOS::ObjectUpdater, TypeMapContainer<TypeList<GameObject, TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > > > >(CellLock<MaNGOS::SingleThreaded<ACE_RW_Thread_Mutex>::Lock> const&, TypeContainerVisitor<MaNGOS::ObjectUpdater, TypeMapContainer<TypeList<GameObject, TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > > > >&)
 1.04    291.53     6.23   126193     0.00     0.00  Map::ProcessRelocationNotifies(unsigned int)
 1.00    297.53     6.00  8236442     0.00     0.00  Player::UpdateVisibilityOf(WorldObject const*, WorldObject*)
 0.98    303.45     5.92 833478576     0.00     0.00  ByteBuffer::append(unsigned char const*, unsigned long)
 0.93    309.06     5.62 12979767     0.00     0.00  Creature::Update(unsigned int)
 0.89    314.42     5.36 908884950     0.00     0.00  Object::GetUInt64Value(unsigned short) const
 0.86    319.56     5.14 17174090     0.00     0.00  MotionMaster::UpdateMotion(unsigned int)
 0.80    324.38     4.82 21499661     0.00     0.00  MaNGOS::PlayerRelocationNotifier::Visit(GridRefManager<Creature>&)
 0.79    329.14     4.76 420155321     0.00     0.00  Map::EnsureGridLoaded(Cell const&)
 0.79    333.88     4.74   571598     0.00     0.00  Player::HandleStealthedUnitsDetection()
 0.77    338.52     4.64  9066965     0.00     0.00  AreaAura::Update(unsigned int)
 0.77    343.13     4.61 101780787     0.00     0.00  WorldSession::SendPacket(WorldPacket const*)
 0.76    347.71     4.58 56271794     0.00     0.00  Unit::isVisibleForOrDetect(Unit const*, WorldObject const*, bool, bool, bool) const
 0.74    352.17     4.47 537378309     0.00     0.00  WorldObject::GetMap() const
 0.73    356.55     4.38 46112045     0.00     0.00  Item::GetProto() const
 0.64    360.41     3.86 145769791     0.00     0.00  WorldObject::_IsWithinDist(WorldObject const*, float, bool) const
 0.64    364.24     3.83 236569711     0.00     0.00  Object::HasFlag(unsigned short, unsigned int) const
 0.63    368.03     3.79 15996998     0.00     0.00  void MaNGOS::ObjectUpdater::Visit<GameObject>(GridRefManager<GameObject>&)
 0.62    371.75     3.72 386199656     0.00     0.00  Map::loaded(CoordPair<64u> const&) const
 0.58    375.23     3.48   362832     0.00     0.00  std::_Rb_tree<unsigned long, unsigned long, std::_Identity<unsigned long>, std::less<unsigned long>, std::allocator<unsigned long> >::_M_copy(std::_Rb_tree_node<unsigned long> const*, std::_Rb_tree_node<unsigned long>*)
 0.57    378.67     3.44 52508354     0.00     0.00  Unit::IsTriggeredAtSpellProcEvent(Unit*, Aura*, SpellEntry const*, unsigned int, unsigned int, WeaponAttackType, bool, bool, SpellProcEventEntry const*&)
 0.55    381.98     3.31 10298734     0.00     0.00  Aura::GetCaster() const
 0.53    385.19     3.21   321611     0.00     0.00  Map::Update(unsigned int const&)
 0.51    388.28     3.09   897295     0.00     0.00  Player::_SetCreateBits(UpdateMask*, Player*) const
 0.51    391.36     3.08     7565     0.00     0.00  SocialMgr::BroadcastToFriendListers(Player*, WorldPacket*)
 0.51    394.41     3.05 17842821     0.00     0.00  Object::_SetCreateBits(UpdateMask*, Player*) const
 0.48    397.31     2.90 413079430     0.00     0.00  NGrid<16u, Player, TypeList<Player, TypeList<Creature, TypeList<Corpse, TypeNull> > >, TypeList<GameObject, TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > >, MaNGOS::SingleThreaded<Player> >::getGridType(unsigned int const&, unsigned int const&)
 0.47    400.13     2.82 10306213     0.00     0.00  void Map::Visit<RGuard<ACE_RW_Thread_Mutex, ACE_Thread_Mutex>, MaNGOS::PlayerRelocationNotifier, TypeMapContainer<TypeList<GameObject, TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > > > >(CellLock<RGuard<ACE_RW_Thread_Mutex, ACE_Thread_Mutex> > const&, TypeContainerVisitor<MaNGOS::PlayerRelocationNotifier, TypeMapContainer<TypeList<GameObject, TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > > > >&)
 0.45    402.86     2.73  5956818     0.00     0.00  WorldSocket::handle_input_missing_data()
 0.45    405.57     2.71 18570120     0.00     0.00  ObjectAccessor::FindPlayer(unsigned long)
 0.45    408.27     2.70  6038022     0.00     0.00  WorldSession::Update(unsigned int)
 0.43    410.85     2.58 24012139     0.00     0.00  void Player::UpdateVisibilityOf<Creature>(WorldObject const*, Creature*, UpdateData&, std::set<Unit*, std::less<Unit*>, std::allocator<Unit*> >&)
 0.43    413.41     2.56    40870     0.00     0.00  Player::BuildPlayerTalentsInfoData(WorldPacket*)
 0.39    415.76     2.35 428955740     0.00     0.00  Map::EnsureGridCreated(CoordPair<64u> const&)
 0.39    418.09     2.33 68997989     0.00     0.00  Map::GetCreature(unsigned long)
 0.38    420.38     2.29                             ReactorRunnable::svc()
 0.37    422.60     2.22 15950817     0.00     0.00  WorldSocket::handle_output(int)
 0.36    424.76     2.16 24461828     0.00     0.00  Object::GetByteValue(unsigned short, unsigned char) const
 0.34    426.82     2.06  2393369     0.00     0.00  Unit::SendAurasFor(Player*)
 0.34    428.88     2.06  4400761     0.00     0.00  WorldSession::HandleMovementOpcodes(WorldPacket&)
 0.34    430.92     2.04 47613342     0.00     0.00  SpellMgr::IsRankSpellDueToSpell(SpellEntry const*, unsigned int) const
 0.34    432.94     2.02  1195214     0.00     0.00  Unit::ProcDamageAndSpellFor(bool, Unit*, unsigned int, unsigned int, WeaponAttackType, SpellEntry const*, unsigned int)
 0.33    434.91     1.97 10727611     0.00     0.00  MaNGOS::PlayerRelocationNotifier::Visit(GridRefManager<Player>&)
 0.31    436.78     1.87 194302888     0.00     0.00  void Map::Visit<RGuard<ACE_RW_Thread_Mutex, ACE_Thread_Mutex>, MaNGOS::MessageDeliverer, TypeMapContainer<TypeList<Player, TypeList<Creature, TypeList<Corpse, TypeNull> > > > >(CellLock<RGuard<ACE_RW_Thread_Mutex, ACE_Thread_Mutex> > const&, TypeContainerVisitor<MaNGOS::MessageDeliverer, TypeMapContainer<TypeList<Player, TypeList<Creature, TypeList<Corpse, TypeNull> > > > >&)
 0.31    438.62     1.84 16957391     0.00     0.00  void Map::Visit<MaNGOS::SingleThreaded<ACE_RW_Thread_Mutex>::Lock, MaNGOS::ObjectUpdater, TypeMapContainer<TypeList<Player, TypeList<Creature, TypeList<Corpse, TypeNull> > > > >(CellLock<MaNGOS::SingleThreaded<ACE_RW_Thread_Mutex>::Lock> const&, TypeContainerVisitor<MaNGOS::ObjectUpdater, TypeMapContainer<TypeList<Player, TypeList<Creature, TypeList<Corpse, TypeNull> > > > >&)
 0.31    440.46     1.84  3585977     0.00     0.00  Player::Update(unsigned int)
 0.30    442.27     1.81      227     0.01     0.01  Player::resetTalents(bool)
 0.28    443.98     1.71  9416892     0.00     0.00  Unit::IsHostileTo(Unit const*) const
 0.28    445.68     1.70   821533     0.00     0.00  Player::addSpell(unsigned int, bool, bool, bool, bool)
 0.28    447.34     1.66 102601150     0.00     0.00  AuthCrypt::EncryptSend(unsigned char*, unsigned long)
 0.26    448.93     1.59 33838264     0.00     0.00  MaNGOS::ObjectMessageDeliverer::Visit(GridRefManager<Player>&)
 0.26    450.51     1.58 18685512     0.00     0.00  void Player::UpdateVisibilityOf<GameObject>(WorldObject const*, GameObject*, UpdateData&, std::set<Unit*, std::less<Unit*>, std::allocator<Unit*> >&)
 0.25    452.02     1.51 463655296     0.00     0.00  utf8::internal::utf_error utf8::internal::validate_next<char const*>(char const*&, char const*, unsigned int*)
 0.25    453.51     1.49  6395036     0.00     0.00  Map::GetCreatureOrPetOrVehicle(unsigned long)
 0.25    454.99     1.48   578224     0.00     0.00  Aura::ReapplyAffectedPassiveAuras(Unit*, bool)
 0.22    456.30     1.32  7811340     0.00     0.00  GameObject::Update(unsigned int)
 0.22    457.61     1.31 24400509     0.00     0.00  MaNGOS::CreatureRelocationNotifier::Visit(GridRefManager<Player>&)

Posted

Useless post ?

So, no everything isn't runs on a single thread, socket (WorldSocket::Update()) is in other thread.

But, yes AchievementMgr::UpdateAchievementCriteria is in main thread and it's not difficult to create a thread to handle the achievement.

For "Cell::Cell(CoordPair<1024u> const&)", it's possible to use pre-calculed value.

Posted
Useless post ?

So, no everything isn't runs on a single thread, socket (WorldSocket::Update()) is in other thread.

But, yes AchievementMgr::UpdateAchievementCriteria is in main thread and it's not difficult to create a thread to handle the achievement.

Thats it. There shouldn't be so muuch sync issues from making this function running on his own thread ? Looks like a good and easy speed up to me. :)

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use